by Ghaffar Nagafpour (5 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 6th August 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Shutdown,Restart and Logoff Windows 9X
API Declarations
'Email:[email protected]
'Location:Iran-Mazandaran-Tonekabon
'-Add 3CommandButton to form
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Dim Ilog, IRes, IShut As Long
Private Sub Command1_Click()
IShut = ExitWindowsEx(1, 1) ‘Shutdown
End Sub
Private Sub Command2_Click()
IRes = ExitWindowsEx(2, 1) ‘Restart
End Sub
Private Sub Command3_Click()
Ilog = ExitWindowsEx(4, 1) ‘Logoff
End Sub
Private Sub Form_Load()
Command1.FontBold = True
Command2.FontBold = True
Command3.FontBold = True
Command1.Caption = "Shutdown Win98"
Command2.Caption = "Restart Win98"
Command3.Caption = "Logoff Win98"
End Sub