if it does not help, use CREATE_NO_WINDOW and/or peek/pump messages :(
SystemExec::wait (int options)
{
while (is_running()) {
- WaitForSingleObject(pid->hProcess, INFINITE);
- Sleep(20);
+ WaitForSingleObject(pid->hProcess, 40);
}
return 0;
}
bool
SystemExec::is_running ()
{
- return pid?true:false;
+ if (!pid) return false;
+ DWORD exit_code;
+ if (GetExitCodeProcess(pid->hProcess, &exit_code)) {
+ if (exit_code == STILL_ACTIVE) return true;
+ }
+ return false;
}
int