摘要载入中… 请稍等…
内容载入中… 请稍等…
| ◎→ | 本类最新 |
|
Win95系统API函数大揭秘 WIN32 API的分类介绍-- WIN32 API的分类介绍-- WIN32 API的分类介绍-- WIN32 API VB中用API函数实现文件夹列表 VB中利用API函数实现特殊窗体的两 |
|
| ◎→相关资源 | |
| C语言入门视频教程 C#编程WinForm入门视频 Asp.net入门视频教程下载 VC++编程视频教程下载 VB窗体文章 HTML入门教程 VB基础视频教程 VB窗体文章 VB文件文章 VB数据库文章 VB-API文章 VB控制文章 | |
| ◎→ | 热门资源 |
| 使用调用外部程序函数实现API函数 使用标签控件调出浏览器 使用API获取颜色 使用 kb_event 函数模拟键盘操作 如何在函数中传递数量不定的参数 如何用api检查任务栏中有多少种输 如何隐藏鼠标指针? |
|
如何关闭/重新启动计算机? 16位Windows用ExitWindows() API函数,而32位Windows则用ExitWindowsEx().32位版本比16位版本多了更多的控制及选项,包括注销及关机。 Declare Function ExitWindows Lib "user" (ByVal uFlags As Long, ByVal _ dwReserved As integer) As integer Const EW_REBOOTSYSTEM = &H43 Const EW_RESTARTWINDOWS = &H42 Sub Command1_Click() Dim iAns As Integer Dim rVal As Integer Dim iButtonType as Integer iButtonType = 4 + 32 ' vbYesNo + vbQuestion ' Ask if the user is sure they want to exit. iAns = MsgBox("Are you sure you want to exit windows?", iButtonType, _ "Exit Windows") If iAns = 6 Then ' Yes pressed ' Call the exit function to Reboot. rVal = ExitWindows(EW_REBOOTSYSTEM, 0) End If End Sub ***** 32位的例子 ***** In a project with 1 commandbutton, place the following code: Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, _ ByVal dwReserved As Long) As Long Private Const EWX_LOGOFF = 0 Private Const EWX_SHUTDOWN = 1 Private Const EWX_REBOOT = 2 Private Const EWX_FORCE = 4 Private Sub Command1_Click() Dim iAns As Integer Dim rVal As Long ' Ask if the user is sure they want to exit. iAns = MsgBox("Are you sure you want to exit windows?", vbQuestion Or _ vbYesNo, "Exit Windows") If iAns = vbYes Then rVal = ExitWindowsEx(EWX_SHUTDOWN, 0&) End If End Sub 查看ExitWindowsEx的详细用法[1]
| 芯友网版权所有 1999-2006 | 著作权与商标声明 | 法律声明 | 服务条款 | 隐私声明 | 联系我们 |