Enable/Disable Taskbar

G

Guest

I know I can fill the screen in VB.NET by starting my window maximized and
without a border.

My question is; in VB.NET is there a way to enable/disable the taskbar much
like doing the "always on top" feature? I would like my program to
automatically "hide" the taskbar when running.

Thanks.

John
 
G

Guest

XP is the operating system to enable/disable the taskbar, but if you want to
hide it then follow these steps:

Start a new Windows application & add two button (Button1 & Button2
respectively)

Button1 will be show Taskbar
Button2 will be hide the Taskbar

Declarations:

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Integer
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal
hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx
As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer

Public Const SWP_HIDEWINDOW = &H80
Public Const SWP_SHOWWINDOW = &H40

Now, doule-click Button1 & add the following code:

Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)

Lastly, double-click Button2 & paste in this code:

Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)

Run the program & click button 2 to hide the Taskbar & button1 to show it.

Remember, to show the Taskbar on form closing or you'll have no Taskbar.

I hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top