How to close the console window?
I use CreateProcess to execute a DOS program and call WaitForSingleObject(..., INFINITE) to wait till it's finished.
But the console window remains open until I close it manually.
How to close the console without my interation?
If I hide the DOS program using the CreateProcess, WaitForSingleObject will wait forever as the hidden console is not closed.
Any way to close the console so that WaitForSingleObject can continue?
How do I know that the process has finished before the console can be closed if it is hidden?