PostQuitMessage

  VOID PostQuitMessage(nExitCode)    
  int nExitCode; /* exit code */

The PostQuitMessage function indicates to Windows that a thread has made a request to terminate. It is typically used in response to a WM_DESTROY message.

Parameters

nExitCode

Specifies an application exit code. It is used as the wParam parameter of the WM_QUIT message.

Return Value

This function does not return a value.

Comments

The PostQuitMessage function posts a WM_QUIT message to the thread's message queue and returns immediately; the function simply indicates to the system that the thread is requesting to quit some time in the future.

When the thread retrieves the WM_QUIT message from its message queue, the thread should exit its message loop and return control to Windows. The exit code returned to Windows must be the wParam parameter of the WM_QUIT message.

See Also

GetMessage, PeekMessage, PostMessage