Click to See Complete Forum and Search --> : Shutting Down Windows
Does anyone know how to give Windows 2000/NT a "Power Button" command? I just want the computer to reboot! No questions asked! No windows shutdown! Just as if you pressed the reset button...
Any ideas?
Im not sure there is an API that sends a short to the reset jumper on the motherboard for the computer to restart immediatly... also if yer in NT and u reboot like that u stand a good change of screwin the OS...
if thats yer intention, i dont think windows added an API that will screw their OS like that.. (i could be wrong)
CiD -=ii=-
V(ery) Basic
May 2nd, 2000, 12:45 AM
Public Declare Function ExitWindowsEx Lib "user32.dll" _
(ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Const EWX_FORCE = 4
'Force apps to quit
Const EWX_REBOOT = 2
'Perform a full reboot
'The code that makes it work:
ExitWindowsEx(EWX_REBOOT Or EWX_FORCE, 0)
Don't tell me if this is not what you want.
:D Just joking
Hope it helps,
Bye!
Fox
May 2nd, 2000, 01:10 AM
I'd say there's no power off -function. The fastest way to shutdown is like V(ery) Basic said with ExitWindowsEx, as I remember there's a parameter to exit without saving aso.
V(ery) Basic
May 2nd, 2000, 02:52 AM
There is a contant for poweroff, but it only works sometimes:
Const EWX_POWEROFF = 8
I just thought I'd add that
V(ery) Basic
May 2nd, 2000, 02:55 AM
I like this function beacuse if you read it it goes like this:
Exit Window Sex
Tihihihi.
I'm very infantile about these things
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.