-
Anyone know of an easy way to re-boot windows after an installation process. I want to do the usual......Settings have changed and you will need to re-start your computer for them to take effect. Do you wish to reboot now??
YES NO
when they hit yes....re-start windows automatically.
I thought there was an API but maybe something better???
Thanks for any suggestions.
-
Here's a tip from this very site.
Copy the following code into the declarations section of a module:
Public Const EWX_LOGOFF = 0
Public Const EWX_SHUTDOWN = 1
Public Const EWX_REBOOT = 2
Public Const EWX_FORCE = 4
Declare Function ExitWindowsEx Lib "user32" Alias _
"ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved _
As Long) As Long
If you wanted to forcefully reboot the computer use the following code:
t& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
HTH
G
-
Thanks....that is perfect. Just what I was looking for!
Thanks for the help!
.....later
-
If you want a dialog box, this code shows the "System Settings Change" message box ("You must restart your computer before the new settings will take effect.")
Code:
Private Const EWX_FORCE = 4
Private Declare Function SHRestartSystemMB _
Lib "shell32" Alias "#59" (ByVal hOwner As Long, ByVal _
sExtraPrompt As String, ByVal uFlags As Long) As Long
Private Sub Command1_Click()
SHRestartSystemMB Me.hwnd, vbNullString, EWX_FORCE
End Sub
-
One note, just incase anyone is using NT, there is a little more involved. If anyone needs it I will post it. I would do it now but I dont have the code here with me.
-
No. My app is only for win98 and me.
anything special with those??
-
Anyone know where to insert this code in the setup1 source code for the Setup Wizard in VB 5.
The forms and such seem weird to me and I can't find the location??