What's Here?
- Members: 117,542
- Replies: 431,823
- Topics: 66,663
- Snippets: 2,394
- Tutorials: 631
- Total Online: 1,673
- Members: 69
- Guests: 1,604
Who's Online?
|
Welcome to Dream.In.Code |
|
|
Getting VB Help is Easy!
Join 117,542 VB Programmers for FREE! Ask your question and get quick answers from experts. There are 1,673 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!
|
Shows how to Shutdown,LogOff and Force Shutdown using VB
|
Submitted By: born2c0de
|
|
|
Rating:
|
|
Views: 33,761 |
Language: Visual Basic
|
|
Last Modified: March 5, 2005 |
Snippet
' SHUT DOWN AND RESTART IN VB6
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()
ExitWindows EWX_REBOOT, &HFFFFFFFF
End Sub
Copy & Paste
|
|
|
Reference Sheets
Bye Bye Ads
Free DIC T-Shirt
Related Sites
Monthly Drawing
Partners
Top Contributors
Top 10 Kudos This Month
|