Windows neu starten/beenden
[Windows 95/98/NT/2000]

22.06.1998


So können Sie Windows neu starten oder beenden:

ERFORDERLICHE OBJEKTE
   1 CommandButton(Command1)
   3 OptionBoxes (Option1, Option2, Option3)
 FORM-CODE
   Private Declare Function ExitWindows Lib _
      "User32" Alias "ExitWindowsEx" (ByVal dwOptions As Long, _
      ByVal dwReserved As Long) As Long
   Const EWX_LOGOFF = 0
   Const EWX_REBOOT = 2
   Const EWX_SHUTDOWN = 1
   Private Sub Command1_Click()
      a = MsgBox("Wollen SIe wirklich fortfahren ?", vbQuestion + vbYesNo)
      If a = 7 Then Exit Sub
      'Neustart
      If Option1.Value = True Then ExitWindows EWX_REBOOT, &HFFFF
      'Anmelden unter anderem Namen anmelden
      If Option2.Value = True Then ExitWindows EWX_LOGOFF, &HFFFF
      'Beenden
      If Option3.Value = True Then ExitWindows EWX_SHUTDOWN, &HFFFF
   End Sub
   Private Sub Form_Load()
      Option1.Caption = "Neu starten"
      Option2.Caption = "Unter anderem Namen anmelden"
      Option3.Caption = "Beenden"
      Command1.Caption = "OK"
   End Sub
 

 

Download - 2 KB