I want to port my linux code to windows. I don't want use cygwin or mingw. I would like to do this via WinApi. So who can help me to write waitpid() analog under windows?
相关问题
- Sorting 3 numbers without branching [closed]
- Multiple sockets for clients to connect to
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
You can use WaitForSingleObject if you have a process handle. You should have obtained that when creating the child process.
CreateProcess
the way to create a new process. Its output is PROCESS_INFORMATION structure.WaitForSingleObject
could wait for the end of the process.Here is the example from MSDN library (
GetExitCodeProcess
was added.):