Wait for a Windows Application to Close
Normally, when you launch a Windows process from another one, the call to create or launch that process returns immediately. Sometimes you need to wait for that child process or application to finish before continuing in the parent that launched it. This is often the case with installation programs that need to launch other installers.
The waiting in this code is accomplished by looping until the call to GetExitCodeProcess returns a value that indicates the child process is no longer active.
(TCHAR and _tcs functions are macros for MBCS/Unicode compatibility)