Export (0) Print
Expand All
2 out of 4 rated this helpful - Rate this topic


Send Feedback

This function shuts down the system.

BOOL ExitWindowsEx(
   UINT uFlags,
   DWORD dwReserved


[in] Specifies the type of shutdown. This parameter must be one of the following values.
Value Description
EWX_POWEROFF Shuts down the system and turns off the power.
Note   This flag is not supported on a Windows Mobile-based Pocket PC.
EWX_REBOOT Shuts down the system and reboots.
[in] Reserved; this parameter is ignored.

Return Values

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.


The ExitWindowsEx function returns as soon as it has initiated the shutdown. The shutdown then proceeds asynchronously. Because the function executes asynchronously, a nonzero return value indicates that the shutdown has been initiated. It does not indicate whether the shutdown will succeed. It is possible that the system, the user, or another application will abort the shutdown.

If the function fails, you can obtain extended error information by calling GetLastError.


Pocket PC: Windows Mobile 5.0 and later.
Smartphone: Windows Mobile 5.0 and later.
OS Versions: Windows CE 5.01 and later.
Header: Aygshell.h.

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.