|
-
Apr 30th, 2006, 12:31 AM
#1
Thread Starter
Junior Member
[RESOLVED] help in shut down a machine
hey people,
Somebody please help in turning off a computer...
the code is as follows....
Private Const EWX_LogOff As Long = 0
Private Const EWX_SHUTDOWN As Long = 1
Private Const EWX_REBOOT As Long = 2
Private Declare Function ExitWindowsEx Lib "user32" _
(ByVal dwOptions As Long, _
ByVal dwReserved As Long) As Long
Public Sub LogOff()
Dim llResult As Long
llResult = ExitWindowsEx(EWX_LogOff, 0&)
End Sub
Public Sub ShutDown()
Dim llResult As Long
llResult = ExitWindowsEx(EWX_SHUTDOWN, 0&)
End Sub
Public Sub Reboot()
Dim llResult As Long
llResult = ExitWindowsEx(EWX_REBOOT, 0&)
End Sub
i am able to log off the computer but not able to turn off and reboot the system. I am using visual basic 6.0 in windows Xp professional with the firewall turned off
please help its urgent
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
|