Computing.Net > Forums > Programming > VB6 Taskbar

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB6 Taskbar

Reply to Message Icon

Name: BaBa
Date: December 31, 2002 at 13:20:25 Pacific
OS: Win98
CPU/Ram: 98M
Comment:

Hi,

I'm writing a small application; however I want to hide the taskbar.(Windows'taskbar)
The bar at the bottom of the screen with all the icons.
I want it dissapears when my application is running.
How can I do that in VB6?

Baba



Sponsored Link
Ads by Google

Response Number 1
Name: James Ricketts
Date: December 31, 2002 at 14:01:43 Pacific
Reply:

Private Declare Function SetWindowPos Lib "user32" (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 Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40

Dim TaskBarHwnd As Long

Private Sub Command1_Click()
If Command1.Caption = "Hide" Then
Call SetWindowPos(TaskBarHwnd, 0&, 0&, 0&, 0&, 0&, SWP_HIDEWINDOW)
Command1.Caption = "Show"
Else
Call SetWindowPos(TaskBarHwnd, 0&, 0&, 0&, 0&, 0&, SWP_SHOWWINDOW)
Command1.Caption = "Hide"
End If
End Sub

'''''''''''''''''''''''''''''''''''''

Hope this is what you wanted


0

Response Number 2
Name: BaBa
Date: December 31, 2002 at 18:34:57 Pacific
Reply:

James,

I tested your code by quickly put a command button on a form.
unfortunately the code doesn't work, only the button caption changed from "Show" to "Hide" each time I clicked on it.
There is a bug in it, unfortunately the code is too advance for me. I can't find out what is wrong.
I greatly appreciate you response. I will play with it see if I can find the bug.

Happy new year!


0

Response Number 3
Name: James Ricketts
Date: January 1, 2003 at 07:43:56 Pacific
Reply:

Sorry, i left out the api call that gets the handle of the taskbar, at the moment it is hiding nothing because the handle it is using is set to 0. The following is the code above with a form load procedure added at the bottom. During the form load it gets the handle of the taskbar, and the "show" and "hide" procedures then have something to Show and Hide:)

Sorry about that!
---------------

Private Declare Function SetWindowPos Lib "user32" (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 Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40
Dim TaskBarHwnd As Long

Private Sub Command1_Click()
If Command1.Caption = "Hide" Then
Call SetWindowPos(TaskBarHwnd, 0&, 0&, 0&, 0&, 0&, SWP_HIDEWINDOW)
Command1.Caption = "Show"
Else
Call SetWindowPos(TaskBarHwnd, 0&, 0&, 0&, 0&, 0&, SWP_SHOWWINDOW)
Command1.Caption = "Hide"
End If
End Sub

Private Sub Form_Load()
TaskBarHwnd = FindWindow("Shell_traywnd", "")
End Sub



0

Response Number 4
Name: BaBa
Date: January 2, 2003 at 14:27:17 Pacific
Reply:

James,

You are great!
I retested the code and it works find. I would never find the problem on my own, or it would take me a while. I would have to learn to understand the Windows API first.

Thank you very much! You are my savior!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Games program Can't compile java



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB6 Taskbar

VB6 screen capture www.computing.net/answers/programming/vb6-screen-capture/4770.html

VB6 Question www.computing.net/answers/programming/vb6-question/7840.html

How to develop Shareware in vb6 www.computing.net/answers/programming/how-to-develop-shareware-in-vb6/11070.html