This function should be used to test for the existence of a process.
The return value of the function is 0 if the process is still running. If the process has exited (or failed in some way) the return value is 1 and the exit code of the process is stored in ExitCode.