解决下这个程序的问题?
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As LongPrivate Sub Command1_Click()
Dim sh As String
If Option1.Value = True Then
sh = ExitWindowsEx(EWX_SHUTDOWN, dwReserved)
End If
If Option2.Value = True Then
sh = ExitWindowsEx(EWX_REBOOT, dwReserved)
End If
If Option1.Value = True Then
sh = ExitWindowsEx(EWX_LOGOFF, dwReserved)
End If
End Sub
Private Sub Form_Load()
Const shutdown = 1
Const reboot = 2
Const logoff = 0
End Sub
为什么在 运行后 不管选择哪一个 最后执行的都是注销,而不是关机 ??是API函数有问题 还是使用错误!!!!
请大家给我指点下迷津!!!!