What is the method of getting the return value from spawning a sub-process within windows? It looks like ShellExecute() is simpler to use than is CreateProcess(), but from the reading I’ve done thus far, neither indicate how to check the return value of the spawned process. How is that done?
Thanks,
Andy
To acquire the exit code of a process on Windows you can use
GetExitCodeProcess().Example application that accepts the process id as an argument and waits for five seconds for it to complete and then acquires its exit code: