Option Explicit
#If Win32 Then Private Declare Function ShutdownWindows _ Lib "user32" Alias _ "ExitWindowsEx" (ByVal uFlags As Long, _ ByVal dwReserved As Long) As Long #Else Private Declare Function ShutdownWindows _ Lib "user" Alias _ "ExitWindows" (ByVal wReturnCode As Integer, _ ByVal dwReserved As Integer) As Integer #End If Private Const EWX_LOGOFF = 0 Private Const EWX_SHUTDOWN = 1 Private Const EWX_REBOOT = 2 Private Const EWX_FORCE = 4 Private Sub Command1_Click() ShutdownWindows EWX_FORCE, 0 End Sub |