Currently you cannot simply wait for a pipe process to terminate. You also cannot determine the processes exit code.
To determine the process exit code of a terminated process, use GetExitCodeProcess() http://msdn.microsoft.com/en-us/library/ms683189(VS.85).aspx or waitpid() http://linux.die.net/man/2/waitpid with option WNOHANG.
To wait for a process, use waitpid() as above without the WNOHANG option to wait (this will also return the exit code though) or WaitForSingleObject() http://msdn.microsoft.com/en-us/library/ms687032.aspx with the process handle and a timeout of INFINITE (this does not return the exit code).