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.
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.
Send Feedback on this topic to the authors