|
-
Sep 13th, 2000, 12:20 PM
#1
Thread Starter
Fanatic Member
hi,
i have this code from megatron
and for some reason what ever option you have, even if you have jst one in the program, all the computer does is logoff,
can anyone help or come up with another solution
Option Explicit
Private Const EWX_POWEROFF = &H8
Private Const EWX_REBOOT = 2
Private Const EWX_LOGOFF = 0
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Timer2_Timer()
If Text1.Text = Label1.Caption Then
If optsd.Value = True Then
'Shut the computer off
ExitWindowsEx EWX_POWEROFF, &H8
ElseIf optr.Value = True Then
'Reboot the computer
ExitWindowsEx EWX_REBOOT, 0
ElseIf optlo.Value = True Then
'Logoff
ExitWindowsEx EWX_LOGOFF, 0
End If
End If
End Sub
Cheers
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
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
|