7,762
社区成员
发帖
与我相关
我的任务
分享
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 ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const sTrayWindow = "Shell_TrayWnd"
Const sTrayNotify = "TrayNotifyWnd"
Const sStartButton = "Button"
Const sAppSwitchBar = "ReBarWindow32"
Const sAppSwitch = "MSTaskSwWClass"
Const sAppIcon = "ToolbarWindow32"
Const sTrayClock = "TrayClockWClass"
Const sDesktopIcon = "ShellDll_DefView"
Const sProgman = "Progman"
Const SW_SHOW = 5
Const SW_HIDE = 0
Public Function HideTray() As Boolean
wnd = FindWindow(sTrayWindow, vbNullString)
wnd = FindWindowEx(wnd, 0, sTrayNotify, vbNullString)
ShowWindow wnd, SW_HIDE
End Function
Public Function ShowTray() As Boolean
wnd = FindWindow(sTrayWindow, vbNullString)
wnd = FindWindowEx(wnd, 0, sTrayNotify, vbNullString)
ShowWindow wnd, SW_SHOW
End Function
Private Sub Command1_Click()
HideTray
End Sub