Author : Big Boss
Date Submitted : 5/21/2007
Category : Windows Operations
Compatibility : VB 6
This code has been accessed 11901 times.
Task : ShutsDown, Logs Off and Restarts Windows Xp - tested and works fine. Isnt the one line of code that clames to work. Just copy and paste.
Declarations
Code
Private Sub cmdForceShutdown_Click()
AdjustToken
ExitWindowsEx (EWX_SHUTDOWN Or EWX_FORCE), &HFFFF
End Sub
Private Sub cmdLogoff_Click()
ExitWindowsEx (EWX_LogOff), &HFFFF
End Sub
Private Sub cmdForceLogoff_Click()
ExitWindowsEx (EWX_LogOff Or EWX_FORCE), &HFFFF
End Sub
Private Sub cmdRestart_Click()
AdjustToken
ExitWindowsEx (EWX_REBOOT), &HFFFF
End Sub
Private Sub cmdShutdown_Click()
AdjustToken
ExitWindowsEx (EWX_SHUTDOWN), &HFFFF
End Sub
Private Sub Form_Load()
End Sub