Hmmmm i just tried the exact code then and it worked make sure you have two different buttons, one to hide it and one to unhide it.
Well i'll look more into that but this is what i found:
Now this totally wiped clean my taskbar... as in i don't see the applications in it and i dont know how to get them back without restarting but as i said before i'll do a bit of research.
Option Strict Off
Public Class Form1
Private Declare Auto Function SendMessage Lib "user32.dll" Alias "SendMessage" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As IntPtr) As IntPtr
Private Declare Auto Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer
Private Declare Auto Function GetDesktopWindow Lib "user32.dll" () As IntPtr
Const WM_SYSCOMMAND As Long = &H112
Const SC_CLOSE As Int32 = &HF060
Dim hwnd As Int32
Dim hwnd2 As Int32
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Dim hDesktop = GetDesktopWindow()
Dim hTray = FindWindowEx(hDesktop, 0, "Shell_TrayWnd", Nothing)
Dim hReBar = FindWindowEx(hTray, 0, "ReBarWindow32", Nothing)
Dim hTask = FindWindowEx(hReBar, 0, "MSTaskSwWClass", Nothing)
Dim hToolbar = FindWindowEx(hTask, 0, "ToolbarWindow32", Nothing)
SendMessage(hToolbar, WM_SYSCOMMAND, SC_CLOSE, Nothing)
'if you do the following it makes the menu black and opens up the shutdown menu WARNING! menu stays black!
SendMessage(hTray, WM_CLOSE, Nothing, Nothing)'i put this into a timer at 1000ms :S very hard to stop as it continuously came up, for some reason the closing event of this menu triggers the button press of the shutdown
'hmmm i'm contemplating whether or not to try the WM_DESTROY, who knows what will happen