-
I have a problem ... i want to restart my computer when the widnows stuck...and i can't do anything...
I have make a program that can restart your computer but windows responce a message to end task some programs.
How can i make the end task automatically and restart the computer.
This solves my problem to make reboot to a host computer that is away from me and i get in with Pc-Anywere 9.0.
-
Add a module to the project and type:
Option Explicit
Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Public Const EWX_REBOOT = 1
Add the following code to Form1
Private Sub Form_Load()
Call ExitWindowsEx(EWX_REBOOT, 1)
End Sub
------------------
Yours sincierly
CyberCarsten http://home18.inet.tele.dk/cyber/
[email protected]
[This message has been edited by CyberCarsten (edited 01-22-2000).]
-
Hi,
I just added all this code to my form:
-----------------------------------------
Private Declare Function ExitWindowsEx Lib "Kernel32" (Byval uFlags as Long, Byval dwReserved as long) As Long
'Add this to an event..
ExitWindowsEx EWX_REBOOT Or EWX_FORCE, 0
-----------------------------------------
hope it helps!