Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
這不是一個好的方式,如果您將任務欄隱藏了,但沒有將之顯示,那我們只有重新開機才能使之重新出現,當使用者發現叫不出任務欄時,他可能會很生氣。
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function ShowWindow Lib "user32" Alias "ShowWindow" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const SW_SHOW = 5
Public Const SW_HIDE = 0
Private hwnd5 as Long
hwnd5 = FindWindow("Shell_traywnd","")
Call ShowWindow(hwnd5, SW_HIDE) '隱藏任務欄
Call ShowWindow(hwnd5, SW_SHOW) '顯示任務欄