ExitProcess Function

The ExitProcess function terminates the calling process and all its threads.

VOID ExitProcess( UINT uExitCode );

Parameters

Parameter Description
uExitCode

The status code for the process. Use the SetExitCodeThread function to specify this value. A return value of zero indicates success. A return value of non-zero indicates failure.

Return Value

This function does not return a value.

Remarks

  • The ExitProcess function terminates the calling process and all its threads. The calling process's registered terminate routines are not called.
  • If the process is a console process, the system does not signal the running threads in other processes that the process has exited.
  • If the process is a GUI process, the system does not signal the running threads in other processes that the process has exited.
  • To enable your application to handle the termination of the calling process in a controlled manner, use the SetConsoleCtrlHandler function.
  • To terminate a thread, use the ExitThread function.

Requirements

Value
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header processthreadsapi.h (include windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

Last updated: October 26, 2023