Hi,
How can we know if the Process has terminated ( if created using CreateProcess OR WinExec() functions ).
Thanks,
Printable View
Hi,
How can we know if the Process has terminated ( if created using CreateProcess OR WinExec() functions ).
Thanks,
Hi,
if you use create CreateProcess :
You can use a structure of type PROCESS_INFORMATION
if (pi.hProcess)
{
DWORD dwExitCode = STILL_ACTIVE;
while (dwExitCode == STILL_ACTIVE)
{
WaitForSingleObject(pi.hProcess, 1000);
GetExitCodeProcess(pi.hProcess, &dwExitCode);
}
}
This while statement will wait and loop untill you process is done.
-- Ron