ExitWindows

3.0

  BOOL ExitWindows(dwReturnCode, reserved)    
  DWORD dwReturnCode; /* return or restart code */
  UINT reserved; /* reserved; must be zero */

The ExitWindows function can restart Windows, terminate Windows and return control to MS-DOS, or terminate Windows and restart the system. Windows sends the WM_QUERYENDSESSION message to notify all applications that a request has been made to restart or terminate Windows. If all applications “agree” to terminate, Windows sends the WM_ENDSESSION message to all applications before terminating.

Parameters

dwReturnCode

Specifies whether Windows should restart, terminate and return control to MS-DOS, or terminate and restart the system. The high-order word of this parameter should be zero. The low-order word specifies the return value to be passed to MS-DOS when Windows terminates. The low-order word can be one of the following values:

Value Meaning

EW_REBOOTSYSTEM Causes Windows to terminate and the system to restart.
EW_RESTARTWINDOWS Causes Windows to restart.

reserved

Reserved; must be zero.

Return Value

The return value is zero if one or more applications refuse to terminate. The function does not return a value if all applications agree to be terminated.

See Also

ExitWindowsExec