Shutdown and Restart API's for VB6
Results 1 to 3 of 3

Thread: Shutdown and Restart API's for VB6

  1. #1
    Registered User
    Join Date
    Aug 2000
    Location
    SoCal USA
    Posts
    210

    Post Shutdown and Restart API's for VB6

    I got to playing with some new shells and like the speed that can be gained without the fluff.
    Could someone here tell me how to access the shutdown and restart commands from the program under design? It'll save a lot on the having to ctrl+alt+del just to shutdown. Thanks for any suggestions.

  2. #2
    Registered User
    Join Date
    Oct 2000
    Location
    Kansas City, MO
    Posts
    1,162

    Post

    Hey Shift...

    Here is what you would use for VB.

    Declaration:

    Private Declare Function ExitWindowsEx Lib "user32" _
    (ByVal uFlags As Long, ByVal dwReserved As Long) As Long


    Then just call the function from a click event or whatever.

    Dim rc As Long

    rs=ExitWIndows(PARAMETER)

    you can use any parameter from the list

    EWX_LOGOFF
    EWX_SHUTDOWN
    EWX_REBOOT
    EWX_FORCE
    EWX_POWEROFF
    EWX_FORCEIFHUNG

    so you would use

    Dim rc As Long

    rc=ExitWindowsEx(EWX_SHUTDOWN)


    ...hope that helps, you can build a class file for the different params. I have built a class file and dll that you can call from your app. lemme know...............eeeshh if I can find it.

    l8r, opiate

  3. #3
    Registered User
    Join Date
    Aug 2000
    Location
    SoCal USA
    Posts
    210

    Post

    Thanks Opiate,

    I'll try it this week. Building classes is a little out of my league right now, but I'm getting there.

    See you around,
    LabRat

Bookmarks

Posting Permissions

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