Microsoft Windows CE 3.0  

Terminating a Process

This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The most common way to terminate a process is to have it return from a WinMainfunction call. You can also terminate a process by having the primary thread of the process call the ExitThreadfunction. A Windows CE process automatically terminates if its primary thread is terminated, even if there are other active threads in existence for the process. ExitThreadreturns the exit code of the process. You can determine the exit code of a process by calling the GetExitCodeProcessfunction. Specify the handle to the process, which you can obtain by calling the CreateProcessor OpenProcessfunction; the function returns the exit code. If the process is still running, the function returns the STILL_ACTIVE termination status.

There are also other, less common, ways of terminating a process: