1.AccessVBA使用API关闭系统声音和打开系统声音的源码方法
AccessVBA使用API关闭系统声音和打开系统声音的方法
Access VBA 使用API 关闭系统声音和打开系统声音的 方法
即让整个系统静音及取消静音的代码如下
------VBA 实现 源码--------------------
Private Declare Function FindWindow Lib "user" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user" 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 "user.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 = & 设置复选框为未选中状态
' Private Const BST_CHECKED = & 设置复选框为选中状态
Private Sub Command1_Click()
Dim hwnd0 As Long ' 用于记录“音量控制”程序的句柄
Shell "sndvol.exe" ' 启动“音量控制”程序
hwnd0 = FindWindow(vbNullString, "主音量")
Dim hwnd1 As Long ' 用于记录“全部静音”复选框句柄
hwnd1 = FindWindowEx(hwnd0, 0&, "Button", "全部静音(&M)") ' 复选框的类名是"Button"
Dim State As Long ' 用于记录复选框状态,如果复选框处于未选中状态,源码子弹力量脚本源码则返回0,源码股东分红 源码选中状态返回1
State = SendMessage(hwnd1,源码phonegap 源码下载 BM_GETCHECK, ByVal CLng(0), ByVal CLng(0))
SendMessage hwnd1, BM_SETCHECK, 1, 0 '使系统静音
SendMessage hwnd1, BM_SETCHECK, 0, 0 '使系统发音
End Sub
2025-01-19 10:49330人浏览
2025-01-19 10:261669人浏览
2025-01-19 10:141995人浏览
2025-01-19 09:32121人浏览
2025-01-19 08:571806人浏览
2025-01-19 08:56289人浏览
據央視新聞報道,針對朝鮮宣布滲透至平壤的無人機為韓軍方所屬,韓國國防部當地時間19日表示,針對朝鮮的單方面主張並無確認及反駁的價值。朝方公布的無人機殘骸圖片來源:央視新聞) 朝鮮外務省11日晚間發表