PDA

Click to See Complete Forum and Search --> : Pls sat why it doesnt work in W2k


shragel
May 2nd, 2001, 09:45 PM
Private Sub Command1_Click()
answer = MsgBox("Are You Sure You Want To Close Windows", vbYesNo)
If answer = vbYes Then
ss = ExitWindowsEx(EWX_SHUTDOWN, 0)
End If
End Sub


Pls explain why it doesnt work in Win 2000 Pro SP1.
And what code will work

amitabh
May 3rd, 2001, 12:36 AM
You might not have permissions to shut down the computer on the machine.

Tygur
May 3rd, 2001, 02:08 AM
Windows 2000 and NT have extra security features. Your program has to do some extra stuff before it can shutdown the computer (basically, it has to request permission). Go to this link:
http://www.planet-source-code.com/xq/ASP/txtCodeId.11156/lngWId.1/qx/vb/scripts/ShowCode.htm

It'll explain everything for you.