|
|
Free VB Projects
|
Shutdown Windows / Reboot system from VB code (Windows 95/98/ME) |
Description:
This VB project enables you to logoff, shutdown Windows or reboot system from within your VB application.
Keywords:
Logoff Windows from VB, Shutdown Windows from VB, reboot system from VB application, Exit Windows from VB code
'Sample project to shutdown windows or reboot computer
'Will not work on windows NT OS
Const EWX_LogOff As Long = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Private Declare Function ExitWindows _
Lib "User32" Alias "ExitWindowsEx" _
(ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
Private Sub Command1_Click()
'Shut down windows
ExitWindows EWX_SHUTDOWN, &HFFFFFFFF
End Sub
Private Sub Command2_Click()
'Reboot computer
ExitWindows EWX_REBOOT, &HFFFFFFFF
End Sub
Return to VB projects
|