What's Here?
- Members: 148,777
- Replies: 504,895
- Topics: 79,511
- Snippets: 2,661
- Tutorials: 705
- Total Online: 1,933
- Members: 88
- Guests: 1,845
|
Shows how to Shutdown,LogOff and Force Shutdown using VB
|
Submitted By: born2c0de
|
|
Rating:
|
|
Views: 38,445 |
Language: Visual Basic
|
|
Last Modified: December 27, 2008 |
Snippet
' SHUT DOWN AND RESTART IN VB6
Const EWX_LogOff As Long = 0
Const EWX_SHUTDOWN As Long = 1
Const EWX_REBOOT As Long = 2
Const EWX_FORCE As Long = 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()
ExitWindows EWX_REBOOT, &HFFFFFFFF
End Sub
Copy & Paste
|
|
|
Be Social
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|