access其最大的优点是:简单易学!非计算机专业的人员,也能学会。所以用它作为数据库的入门来学习是非常不错的选择。本文主要讲诉怎样一步步搭建一个小型的ACCESS数据库今天在确认实习......
Access VBA 使用API 关闭系统声音和打开系统声音的 方法
Access VBA 使用API 关闭系统声音和打开系统声音的 方法
即让整个系统静音及取消静音的代码如下
------VBA 实现 源码--------------------
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const BM_GETCHECK = &HF0 ' 取得复选框状态
Private Const BM_SETCHECK = &HF1 '设置复选框状态
' Private Const BST_UNCHECKED = &00 设置复选框为未选中状态
' Private Const BST_CHECKED = &01 设置复选框为选中状态
Private Sub Command1_Click()
Dim hwnd0 As Long ' 用于记录“音量控制”程序的句柄
Shell "sndvol32.exe" ' 启动“音量控制”程序
hwnd0 = FindWindow(vbNullString, "主音量")
Dim hwnd1 As Long ' 用于记录“全部静音”复选框句柄
hwnd1 = FindWindowEx(hwnd0, 0&, "Button", "全部静音(&M)") ' 复选框的类名是"Button"
Dim State As Long ' 用于记录复选框状态,如果复选框处于未选中状态,则返回0,选中状态返回1
State = SendMessage(hwnd1, BM_GETCHECK, ByVal CLng(0), ByVal CLng(0))
SendMessage hwnd1, BM_SETCHECK, 1, 0 '使系统静音
SendMessage hwnd1, BM_SETCHECK, 0, 0 '使系统发音
End Sub
相关文章
- 详细阅读
- 详细阅读
- 详细阅读
-
Access2016数据库开发教程1详细阅读
第一章开发平台概述1.1盟威软件快速开发平台是什么?1.1.1概述《盟威软件快速开发平台(Access版)》是一款免费的快速开发平台。该平台主要用于企业中各种管理信息系统的开发,不会编程的......
2022-04-19 488 Access Access2016 Access2016数据库开发 数据库开发
- 详细阅读