注释:Api function and the constants required for ExitWindowsEx
Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags As Long, _
ByVal dwReserved As Long)
Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_REBOOT = 2
Public Const EWX_SHUTDOWN = 1
Private Sub cmdShutdown_Click()
Dim MsgRes As Long
注释:Make sure that the user really want to shutdown
MsgRes = MsgBox("Are you sure you want to Shut Down Windows 95?", vbYesNo Or vbQuestion)
注释:If the user selects no, exit this sub
If MsgRes = vbNo Then Exit Sub
注释:else, shutdown windows and unload this form
Call ExitWindowsEx(EWX_SHUTDOWN, 0)
Unload Me
End Sub
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073










