Private Sub cmdShutdown_Click()
Dim flags As Long
If optCommand(0).Value Then
flags = EWX_LOGOFF
ElseIf optCommand(1).Value Then
flags = EWX_POWEROFF
ElseIf optCommand(2).Value Then
flags = EWX_REBOOT
Else
flags = EWX_SHUTDOWN
End If
If optOption(0).Value Then
' No options.
ElseIf optOption(1).Value Then
flags = flags + EWX_FORCE
Else
flags = flags + EWX_FORCEIFHUNG
End If
ExitWindowsEx flags, 0
End Sub
|