Process Exit Code

Each process has an exit code that can be accessed by other processes and can be used to indicate success or failure. A process sets an exit code in the value returned from either WinMain or the "C" main function. A process could, for example, return 0 to indicate success or a non-zero value indicating an error code.

An application can call the function GetExitCodeProcess to obtain theexit code for another application. This function is passed the process kernel object handle to the other process and a pointer to a DWORD to receive the exit code:

DWORD dwExitCode;
GetExitCodeProcess(hProcess, &dwExitCode);

On return, dwExitCode will contain the exit code set by the application, or the value STILL_ACTIVE if the application has ...

Get Windows® CE 3.0 Application Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.