Displaying the Shut Down Windows dialog

This is a discussion on Displaying the Shut Down Windows dialog within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I was wondering if there is a function that will display the Shut Down Windows dialog. Apparently, in VB ...

  1. #1
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,261

    Red face Displaying the Shut Down Windows dialog

    Hi,
    I was wondering if there is a function that will display the Shut Down Windows dialog. Apparently, in VB you can declare function "#60" in shell32.dll and it'll come up, but how do you do that in C/C++?

  2. #2
    Registered User (TNT)'s Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    339
    Hi,

    Im not 100% sure, but i think as its part of the shell it would be hard to do in c++. So what you should do it make your own dlg and simply use ExitWindowsEx(), it would not be to hard to create your own shutdown dlg box.

    Cheers
    TNT
    TNT
    You Can Stop Me, But You Cant Stop Us All

  3. #3
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,261

    Talking

    Yes! I figured it out!

    I first have to use LoadLibrary to get the module handle for the DLL, then GetProcAddress to get the address for the function, like so:-
    Code:
    FARPROC SHShutdownWindows;
    HMODULE hShellDll;
    
    hShellDll = LoadLibrary("shell32.dll");
    SHShutdownWindows = GetProcAddress(hShellDll, MAKEINTRESOURCE(60));
    Then, by calling the function:-
    Code:
    (*SHShutdownWindows)(0);
    I get a rather spiffy Shut Down Windows dialog. Easy when you know how :P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 06:05 PM
  2. First-time Windows programming
    By Grayson_Peddie in forum Windows Programming
    Replies: 5
    Last Post: 06-05-2002, 11:09 PM
  3. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  4. Displaying a picture on a dialog
    By CodeMonkey in forum Windows Programming
    Replies: 2
    Last Post: 02-14-2002, 10:14 AM

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