When launching child processes from applications I used to use GetExitCodeProcess on the process handle, checking if STILL_ACTIVE is returned if it is still running.. heres the smart way!
For instance for threads:
HANDLE hThread;
hThread = CreateThread(NULL,0,StartThread,&threadParam,0,NULL);
if(hThread1 != NULL)
{
WaitForSingleObject(hThread,INFINITE);
}
For processes:
PROCESS_INFORMATION pi={0};
if (CreateProcess (parameters, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, &pi))
{
WaitForSingleObject(pi.hProcess,INFINITE);
}
1 comment:
What's Up everybody, prime chat board I find It incredibly helpful & it has helped me out so much
I hope to be able to contribute and help others like this forum has helped me
_________________
[URL=http://www.certforums.co.uk/forums/lastpostinthread345012.html][B]mcitp enterprise[/B][/URL]
Post a Comment