Access数据库怎么设置不打印标题?Access数据库打印的时候,想要设置不打印标题,该怎么设置呢?下面我们就来看看Access不打印标题的方法,需要的朋友可以参考下......
2023-01-15
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
相关文章
Access数据库怎么设置不打印标题?Access数据库打印的时候,想要设置不打印标题,该怎么设置呢?下面我们就来看看Access不打印标题的方法,需要的朋友可以参考下......
2023-01-15
Access数据库报表怎么设置四页打印?Access中的报表想要打印成四页的效果,该怎么对打印进行设置呢?下面我们就来看看详细的教程,需要的朋友可以参考下......
2023-01-15
access分割窗体和空白窗体怎么创建?access中想要创建窗体,该怎么创建分割窗体和空白窗体呢?下面我们就来看看详细的教程,需要的朋友可以参考下......
2023-01-15
Access数据库表格怎么使用信纸进行打印?Access表格打印的额时候,想要使用信纸打印,该怎么设置呢?下面我们就来看看详细的教程,需要的朋友可以参考下......
2023-01-15