How to shutdown a PC with VB6?

2 Responses to “How to shutdown a PC with VB6?”

  1. Margus M Says:

    ‘ SHUT DOWN IN VB6
    Const EWX_LOGOFF As Long = 0
    Const EWX_SHUTDOWN As Long = 1
    Const EWX_REBOOT As Long = 2
    Const EWX_FORCE As Long = 4

    ‘api reperence declaration
    Private Declare Function ExitWindows _
    Lib “User32″ Alias “ExitWindowsEx” _
    (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long

    ‘add button to form, if it is pressed shut dow will be called
    Private Sub Command1_Click()
    ‘Shut down windows
    ExitWindows EWX_SHUTDOWN, &HFFFFFFFF
    End Sub

    Quick Payday Loan

  2. peekay Says:

    vista:
    shell “shutdown /f /s /t 1″,vbhide

    xp:
    shell “shutdown -f -s -t 1″,vbhide

    Debt and Consolidation

Leave a Reply

CommentLuv badge

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

Security Code: