Program Resource

Resource libraries for programmers and developers

How to wait for process termination when parent process terminates before child process

If you want to call external process and want to wait for it to terminate, you can call CreateProcess function and wait using WaitForSingeObject API. However, some process just launches child process and terminates immediately, resulting application still running but process terminates and returns to code. Below is sample code you can use in such case, where it monitors for process and child processes, and wait for all family process to terminate.