Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am trying to shut down the computer after saving files and have tried to use this code which was supplied on another thread. The code works fine for loging off but I can't get it to shut down the computer. Am I missing something?
Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (ByVal uFlags As _
Integer, ByVal dwReserved As Integer) As Integer
Public Enum Choices
Logoff = 0
Shutdown = 1
Reboot = 2
ForceLogOff = 4
ForceReboot = 6
PowerDown = 8
ForcePowerDown = 12
Public Sub ExitFromWindows(ByVal Choice As Choices)
Thanks Malcolm Mack
0 · ·