声明部分
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
代码部分
Private Sub Command1_Click()
ExitWindowsEx EWX_LOGOFF, 0
End Sub
Private Sub Command2_Click()
ExitWindowsEx EWX_REBOOT, 0
End Sub
Private Sub Command3_Click()
ExitWindowsEx EWX_SHUTDOWN, 0
End Sub