A slight modification to Benoit's answer. You can create an event in the parent process and wait for this event with WaitForSingleObject . This event can then be reported to the child by calling SetEvent .
http://msdn.microsoft.com/en-us/library/ms686211%28v=vs.85%29.aspx
It is important that the child process inherits all inherited descriptors, so the fifth parameter true (bInheritHandles) must be set for CreateProcess.
Therefore, the child process does not have to exit to verify that the file was written.
source share