checking the status of child process from parent without going on a wait loop
Posted on 2004-09-13
I have an application A written in VC++ ...which is working fine...
On click of a button, I created a new process B from A using CreateProcess syntax.(so that both A and B can run simultaneously)
Now, i want to check the status of B and see whether it has finished executing or not..)
If i do this DWORD dwExitCode = 0;
// Error -> call 'GetLastError()'
while(dwExitCode == STILL_ACTIVE)
i can figure out when process B terminates..but the problem is A goes into a sort of a wait loop...i dont want to put A into a wait loop and users should be able to run application A as usual till B finishes execution...ALso as soon as B finishes execution, A should be informed so that I can create a log file with some information such as time taken, username details..etc....
how do i do this??