How to shut off the coputer

How do I turn off the computer.  I am guessing that is just closing explorer,  but I just want tobe sure.
manly9004Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

syleshCommented:
'Hi
'Next time when u ask question Explain
'question more brief ,
'To shut down using From VB this is code.



Option Explicit
    ' Constants used by Windows API:
    Const EWX_SHUTDOWN As Long = 1
    Const EWX_POWEROFF As Long = 8
    Const API_ERROR As Long = 0

    ' Declare API Functions:
    Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, _
                                             ByVal dwReserved As Long) As Long

Private Sub Form_Load()
    ' Call shutdown function. Power off if possible.

    Dim lResult As Long

    lResult = ExitWindowsEx((EWX_SHUTDOWN Or EWX_POWEROFF), 0)
    If lResult = API_ERROR Then
        MsgBox "Error! Can't shut down Windows.", vbExclamation
    Else
        Unload Me
    End If
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
master01Commented:
I assume that you mean shut down windows.

Put this in a module:
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long

put this wherever you want to shut windows down.
VARIABLE = ExitWindowsEx(1, 1)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.