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