If the specified process has not terminated, the termination status returned is STILL_ACTIVE. If the process has terminated, the termination status returned may be one of the following:
- The exit value specified in ExitProcess or TerminateProcess. 
 - The return value from the main or WinMain function of the process. 
 - The exception value for an unhandled exception that caused the process to terminate. 
 
BOOLEAN RtGetExitCodeProcess(
    HANDLE hProcess,
    LPDWORD lpExitCode
);
Parameters
hProcess 
- Handle to the process. 
 lpExitCode 
- Pointer to a 32-bit variable to receive the process termination status. 
 
Remarks
If the specified process has not terminated, the termination status returned is STILL_ACTIVE. If the process has terminated, the termination status returned may be one of the following:
- The exit value specified in ExitProcess or RtTerminateProcess. 
 - The return value from the main or WinMain function of the process. 
 - The exception value for an unhandled exception that caused the process to terminate. 
 
Return Values
- TRUE 
 - Success. 
 - FALSE 
 - Failure. For extended error information, see the Windows' GetLastError function. 
 
Requirements
| Versions | 
Defined in | 
Include | 
Link to | 
| INtime 3.0 | 
intime/nt/include/iwin32x.h | 
iwin32x.h | 
iwin32x.lib | 
 
Notes
- This function operates in the Windows portion of your application. 
 - The iwin32 API also includes an RtGetExitCodeProcess function that operates in the real-time portion of your application. 
 
See Also
ExitProcess, RtTerminateProcess, iwin32x API, iwin32 Overview