ExitWindowsEx(EWX_SHUTDOWN, 0);

This is a discussion on ExitWindowsEx(EWX_SHUTDOWN, 0); within the Windows Programming forums, part of the Platform Specific Boards category; For some reason, using: ExitWindowsEx(EWX_SHUTDOWN, 0); Only logs off of Windows; it doesn't shut it down like the API reference ...

  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,789
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21