by Bhuwan Chand Joshi (69 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 2nd May 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Shutdown your machine using VB 6.0.
API Declarations
Public Declare Function ExitWindowsEx Lib "User32" Alias "ExitWindowsEx"(ByVal uFlags as Long,ByVal dwReserved as Long) as Long
//You can execute any one call as per your requirement.
//Shut down the machine
Call ExitWindowsEx(EWX_SHUTDOWN,0)
//Power Off the machine
Call ExitWindowsEx(EWX_POWEROFF,0)
//Logoff the machine
Call ExitWindowsEx(EWX_LOGOFF,0)
//Restart your machine
Call ExitWindowsEx(EWX_REBOOT,0)
End Sub