PostQuitMessage

2.x

  void PostQuitMessage(nExitCode)    
  int nExitCode; /* exit code, */  

The PostQuitMessage function posts a message to Windows indicating that an application is requesting to terminate execution (quit). This function is typically used in response to a WM_DESTROY message.

Parameters

nExitCode

Specifies an application-defined exit code. It must be 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 application and returns immediately; the function simply indicates to the system that the application will request to quit some time in the future.

When the application receives the WM_QUIT message, it should exit the message loop in the main function and return control to Windows.

See Also

GetMessage