ExitWindows macro
Calls the ExitWindowsEx function to log off the interactive user. Applications should call ExitWindowsEx directly.
Syntax
BOOL WINAPI ExitWindows( DWORD dwReserved, UINT uReserved );
Parameters
- dwReserved
-
This parameter must be zero.
- uReserved
-
This parameter must be zero.
Return value
If the call succeeds, the return value is nonzero.
If the call fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The system sends a WM_QUERYENDSESSION to the main window of each running application.
An application agrees to terminate by returning TRUE when it receives this message (or by allowing the DefWindowProc function to process the message). If any application returns FALSE when it receives the WM_QUERYENDSESSION message, the logoff is canceled.
After the system processes the results of the WM_QUERYENDSESSION message, it sends the WM_ENDSESSION message with the wParam parameter set to TRUE if the system is shutting down and to FALSE if it is not.
Examples
For an example, see How to Log Off the Current User.
Requirements
|
Minimum supported client | Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server | Windows Server 2003 [desktop apps only] |
|
Header |
|
See also