[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Shut Down the computer

Could you please tell me the command or code that can be used in VB6 to shut down the computer ??
0
Ghada
Asked:
Ghada
1 Solution
 
ShaneCourtrilleCommented:
Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long)

Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_REBOOT = 2
Public Const EWX_SHUTDOWN = 1

Private Sub cmdButton1_Click()

Call ExitWindowsEx(EWX_SHUTDOWN, 0)
Unload Me

End Sub
 

0
 
Erick37Commented:
Also see:

"PRB: ExitWindowsEx API Does Not Reboot Windows NT"

http://support.microsoft.com/support/kb/articles/Q176/6/95.asp
0
 
GhadaAuthor Commented:
Thank you ShanCoutrille's for providing me the correct answer .
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now