Function:
ExitWindowsEx(uFlags, dwReserved)

 

Description:
Shuts down or reboots the user's computer.

 

Parameters:
uFlags: One or more of the following flags specifying how to shut down or reboot the computer.
4 = Force any applications to quit instead of prompting the user to close them.
0 = Log off the network.
8 = Shut down the system and, if possible, turn the computer off.
2= Perform a full reboot of the system.
1 = Shut down the system.

dwReserved: Reserved for future versions of Windows. Always set to 0.

 

Returns:
0 if an error occured, or 1 if successful.

 

Example:
Click on the calc icon to view a sample of the ExitWindowsEx function.