1,486
社区成员
发帖
与我相关
我的任务
分享
Const TASKBAR_CLASSNAME = "Shell_TrayWnd"
Const SW_HIDE = 0
Const SW_SHOW = 5
Private hTaskBar As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Form_Load()
hTaskBar = FindWindow(TASKBAR_CLASSNAME, vbNullString)
If hTaskBar Then
Call ShowWindow(hTaskBar, SW_HIDE)
Else
MsgBox "无法找到任务栏。", vbInformation, "提示"
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If hTaskBar Then Call ShowWindow(hTaskBar, SW_SHOW)
End Sub