I am writing a program which is used to launch different command line applications. The problem is when I run 1 application, command prompt takes control of the program and will not allow me to access my GUI to launch another. I believe this is because System() creates a new process, Then once the command prompt is exited, control is given back to the GUI.
Is there any alternatives that will allow me to Launch several command line programs at once ? like in a thread for example.
Any help on this would be greatly appreciated.
::Dan
Use the
CreateProcessfunction; this create a new process but doesn’t wait for it to finish. Instead, you can wait for it yourself using theWaitForSingleObjectfunction.If you are starting multiple processes you may want to consider using
WaitForMultipleObjectswhich lets you wait for a whole list of processes (and other objects) at once.See the list of wait functions at the MSDN for more alternatives on how to wait for a process to finish.