|
-
Jan 22nd, 2000, 04:32 AM
#1
Thread Starter
Lively Member
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.
-
Jan 22nd, 2000, 06:10 AM
#2
Frenzied Member
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).]
-
Jan 22nd, 2000, 06:18 AM
#3
Hyperactive Member
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|