|
通过将窗口设为完全透明的方式隐藏Access程序窗口,隐藏之后仍然可以使用快捷菜单,注意所有窗体都必须设为弹出(不用将模式属性设为是)
- Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
- Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
- Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
- '=======================================================================
- '函数名称: HideAccessWindow
- '功能描述: 隐藏Access程序窗口,隐藏之后仍然可以使用快捷菜单,注意隐藏之后要窗体要
- ' 将“弹出”属性设为“是”才能正常打开
- '输入参数: 参数1 Hidden 必需的,设为True隐藏,设为False取消隐藏
- '返回参数: 无
- '兼 容 性:
- '使用示例: HideAccessWindow True
- '相关调用: GetWindowLong() SetWindowLong() SetLayeredWindowAttributes()
- '作 者: 红尘如烟
- '创建日期: 2009-2-1
- '=======================================================================
- Public Function HideAccessWindow(Hidden As Boolean)
- On Error Resume Next
- Dim lngResult As Long
- If Hidden Then lngResult = GetWindowLong(hWndAccessApp, -20) or &H80000
- SetWindowLong hWndAccessApp, -20, lngResult
- SetLayeredWindowAttributes hWndAccessApp, 0, 0, &H2
- End Function
复制代码
|
|