Private Const SWP_HIDEWINDOW = &H80
Private Const SWP_SHOWWINDOW = &H40
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Long, ByVal hWndinsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd
Public Sub ViewTaskBar(lbValue As Boolean)
Dim llResult As Long
llResult = FindWindow("Shell_traywnd", "")
If llResult Then
If lbValue Then
llResult = SetWindowPos(llResult, 0, 0, 0, 0, 0, SWP_SHOWWINDOW) Else llResult = SetWindowPos(llResult, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
End If
End If
End Sub
调用过程ViewTaskBar,lbValue为false时隐藏任务栏。
如果文章对您有帮助,给个赞赏吧!