Results 1 to 6 of 6

Thread: Shutting Down Windows

  1. #1
    Guest

    Exclamation

    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?

  2. #2
    Guest
    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=-

  3. #3
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    Wink I think there is a way

    Code:
    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.

    Just joking

    Hope it helps,

    Bye!
    Courgettes.

  4. #4
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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.

  5. #5
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    There is a contant for poweroff, but it only works sometimes:

    Code:
    Const EWX_POWEROFF = 8
    I just thought I'd add that
    Courgettes.

  6. #6
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    I like this function beacuse if you read it it goes like this:

    Exit Window Sex

    Tihihihi.

    I'm very infantile about these things
    Courgettes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width