17 Jun
2006
17 Jun
'06
4:14 a.m.
<tkho(a)ucla.edu> wrote:
+ ok (CreateProcess(NULL, "notepad.exe", NULL, NULL, FALSE, 0, NULL, NULL, + &si, &pi), + "CreateProcess error=%ld\n", GetLastError()); + + while (elapsed < timeout) + { + Sleep(50); + elapsed += 50; + + hNotepad = GetForegroundWindow(); + if (!hNotepad) + continue; + if (GetWindowText(hNotepad, wndTitle, 30) == 0) + continue; + if (strstr(wndTitle, "Notepad")) + break; + }
WaitForInputIdle is supposed to be used instead of the while loop above. -- Dmitry.