|
-
Mar 24th, 2000, 03:40 AM
#2
transcendental analytic
I don't know about how to use this with the network, but this is the code for how to shutdown/restart or suspend:
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Declare Function SetSystemPowerState Lib "kernel32" (ByVal fSuspend As Long, ByVal fForce As Long) As Long
Enum exitmode
Shutdown = 0
Restart = 1
Suspend = 2
End Enum
Sub ExitWindows(how As exitmode)
Select Case how
Case 0
t& = ExitWindowsEx(1, 0)
Case 1
t& = ExitWindowsEx(2 Or 4, 0)
Case 2
SetSystemPowerState 1, 1
Case Else
MsgBox "Invalid exitmode calling ExitWindows... Try to use your brain or VB!"
End Select
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|