Thread: ExitWindowsEx(EWX_SHUTDOWN, 0);

  1. #1
    Registered User ExDigit's Avatar
    Join Date
    Jan 2002
    Posts
    31

    ExitWindowsEx(EWX_SHUTDOWN, 0);

    For some reason, using:

    ExitWindowsEx(EWX_SHUTDOWN, 0);

    Only logs off of Windows; it doesn't shut it down like the API reference says. Can anyone help me shut down Windows further than logging off?

    Thanks,
    Chris

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Have you tried;

    EWX_POWEROFF as the first parameter?

  3. #3
    Registered User ExDigit's Avatar
    Join Date
    Jan 2002
    Posts
    31

    Unhappy D'oh!

    Oops, about 1 minute after I posted I decided to try:

    ExitWindowsEx(EWX_SHUTDOWN | EWX_POWEROFF, 0);

    Works now. This means I made my first useful Windows utility.. it should be available on my website shortly.

Popular pages Recent additions subscribe to a feed