Værsgo...
Const EWX_FORCE = 4 ' tving Windows til dette (???)
Const EWX_LOGOFF = 0 ' log af Windows
Const EWX_REBOOT = 2 ' genstart Windows
Const EWX_SHUTDOWN = 1 ' luk Windows
'*** Windows API-kald til lukning af systemet.
Private Declare Function ExitWindowsEx _
Lib "user32" ( _
ByVal uFlags As Long, _
ByVal dwReserved As Long _
) As Long
'
' Lukker systemet ned.
'
Private Sub btnExitWin_Click()
ExitWindowsEx EWX_SHUTDOWN, 0
End Sub
'
' Logger brugeren af.
'
Private Sub btnLogOff_Click()
ExitWindowsEx EWX_LOGOFF, 0
End Sub
'
' Genstarter systemet.
'
Private Sub btnReboot_Click()
ExitWindowsEx EWX_REBOOT, 0
End Sub
Med Venlig Hilsen
Morten Torndahl Pedersen