Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reboot Parameter

Status
Not open for further replies.

camidon

Programmer
May 9, 2000
268
US
I'm trying to find a parameter that will force Windows to reboot as if you had held down the shift key while clicking the OK on the restart button.
 
Here is a API call for your task to perform.<br><br>Use the function ExitWindowsEx. This function has two parameters. The first is one or more flags to instruct windows how to shutdown. These are listed below along with the declarations. The second part of the function is reserved, and it set to zero. It is important to unload your application to help the system to shut down smoothly. The declarations for this function are below.<br>Public Const EWX_LOGOFF = 0 <br>Public Const EWX_SHUTDOWN = 1 <br>Public Const EWX_REBOOT = 2 <br>Public Const EWX_FORCE = 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>Declare Function ExitWindowsEx Lib &quot;user32&quot; Alias _<br>&quot;ExitWindowsEx&quot; (ByVal uFlags As Long, ByVal dwReserved _<br>As Long) As Long&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>If you wanted to forcefully reboot the computer use the following code:<br><br>t& = ExitWindowsEx(EWX_FORCE OR EWX_REBOOT, 0)<br><br>I hope this you required if I am not wrong.
 
I think that would serve his purpose, but which of those constant combinations would give the Quick Restart (restart windows without rebooting the computer itself) the behavior he described? <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
EWX_LOGOFF serves the same purpose by closing all programs and reinitializing the startup apps. <p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top