I am using SendInput to read a line from a file and then simulate
typing it into an Edit Control box using SendInput. When I read a file
with multiple line, the output file saves the original first line as
the second line, original second line as the third line, etc... The
last line of the original file never gets saved but it appears in the
Edit box. I am using GetWindowText() to grab the next after it has
been typed into the Edit box. It seems that the GetWindow Text command
is called before the keyboard buffer has a chance to empty into the
edit field. Please find code attached below.
Any help would be much appreciated.
Thanks!
-------
CString type( CString inStr )
{
// inStr contains the text of the current line
CString outStr;
for ( int i = 0; i < inStr.GetLenght(), i++ )
{
currChar = inStr.GetAt( i );
simulate( currChar ); // this function outputs one char at
a time
}
m_EditField.GetWindowText( outStr );
m_EditField.SetWindowText( "" );
return outStr;
}