Results 1 to 5 of 5

Thread: Shutdown windows

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    33

    Post

    how can i Shutdown windows with api please help me

  2. #2
    Guest
    Take a look at this thread.

  3. #3
    Guest
    Code:
    Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
    Private Const EWX_POWEROFF = &H8
    Private Const EWX_FORCE = 4
    
    Private Sub Command1_Click()
        ExitWindowsEx EWX_POWEROFF Or EWX_FORCE, 0
    End Sub

  4. #4
    Fanatic Member ExtremePimpness's Avatar
    Join Date
    Jan 2001
    Location
    Indianapolis, Indana - USA
    Posts
    550

    This is the command..

    This is the command the shut down box gives your computer:

    [code]

    shell(Rundll32.exe KRNL386.EXE,ExitKernel)

    [\code]
    it's not api but it is short and doesn't cause a improper shutdown(no scandisk)
    and it doesn't prompt you to close anything it just shuts down.
    Last edited by ExtremePimpness; Feb 15th, 2001 at 12:52 AM.

  5. #5
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    private declare function ExitWindowsEx Lib "user32" _
    (byval dwFlags As Long,byval dwReserved As Long) _
    As Long

    To Shut Down, Pass 0 To dwFlags

    This Function If Not Successful Returns A Numeric Code In Case Any App Cancelled The ShutDown.

    Eg:

    ExitWindowsEx 0,0

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