Click to See Complete Forum and Search --> : please help me
skyfam
Jan 29th, 2001, 07:51 PM
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.
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
DarkJedi9
Jan 30th, 2001, 01:29 PM
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.
DarkJedi9
Jan 31st, 2001, 02:47 PM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.