I need to hide the taskbar with API when i run any form
and unhide the taskbar when i close or unload the form
Printable View
I need to hide the taskbar with API when i run any form
and unhide the taskbar when i close or unload the form
Use the FindWindow API function to find the taskbar, and the ShowWindow API function to show or hide it.
Code:Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, ByVal _
nCmdShow As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Dim tray&
Dim shtray&
Private Sub Form_Load()
tray& = FindWindow ("Shell_TrayWnd", vbNullString)
shtray& = ShowWindow(tray&, SW_HIDE)
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
tray& = FindWindow("Shell_TrayWnd", vbNullString)
shtray& = ShowWindow(tray&, SW_SHOW)
End Sub
How did you find out the class name (if that's the right term) was Shell_TrayWnd?
I used a API/Window's Spy.
Use Spy++, which is shipped with Visual Studio.
I don't have Spy++, I think it's because I didn't get the full Visual Studios. I only got the VB6 portion of it.