Here is something I use, which I found on the net some time ago.
Kay
Imports System.Runtime.InteropServices
Public Class BarControl
<DllImport("coredll.dll", EntryPoint:="GetForegroundWindow",
SetLastError:=True)> Private Shared Function GetForegroundWindow() As IntPtr
End Function
<DllImport("aygshell.dll", EntryPoint:="SHFullScreen", SetLastError:=True)>
Private Shared Function SHFullScreen(ByVal hwndRequester As IntPtr, ByVal
dwState As Integer) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="EnableWindow")> Private Shared
Function EnableWindow(ByVal hwnd As IntPtr, ByVal bEnable As Boolean) As
Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="FindWindow")> Private Shared Function
FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As
IntPtr
End Function
Private Const SHFS_SHOWSTARTICON As Integer = &H10
Private Const SHFS_HIDESTARTICON As Integer = &H20
Private Const SHFS_HIDESIPBUTTON As Integer = &H8
Private Const SHFS_SHOWSIPBUTTON As Integer = &H4
Private Const SHFS_SHOWTASKBAR As Integer = &H1
Private Const SHFS_HIDETASKBAR As Integer = &H2
Private Shared Function SetTaskBarEnabled(ByVal bEnabled As Boolean) As
Boolean
Dim hwnd As IntPtr = FindWindow("HHTaskBar", Nothing)
If Not hwnd.Equals(IntPtr.Zero) Then
If bEnabled Then
Return EnableWindow(hwnd, True)
Else
Return EnableWindow(hwnd, False)
End If
End If
Return True
End Function
Private Shared Function SetTaskbarVisible(ByVal visible As Boolean) As
Boolean
Dim hwnd As IntPtr = FindWindow("HHTaskBar", Nothing)
If Not hwnd.Equals(IntPtr.Zero) Then
If visible Then
Return SHFullScreen(hwnd, SHFS_SHOWTASKBAR)
Else
Return SHFullScreen(hwnd, SHFS_HIDETASKBAR)
End If
End If
End Function
Private Shared Function SetStartButtonVisible(ByVal visible As Boolean) As
Boolean
Dim hwnd As IntPtr = GetForegroundWindow()
If Not hwnd.Equals(IntPtr.Zero) Then
If visible Then
Return SHFullScreen(hwnd, SHFS_SHOWSTARTICON)
Else
Return SHFullScreen(hwnd, SHFS_HIDESTARTICON)
End If
End If
End Function
Private Shared Function SetSIPVisible(ByVal visible As Boolean) As Boolean
Dim hwnd As IntPtr = GetForegroundWindow()
If Not hwnd.Equals(IntPtr.Zero) Then
If visible Then
Return SHFullScreen(hwnd, SHFS_HIDESIPBUTTON)
Else
Return SHFullScreen(hwnd, SHFS_HIDESIPBUTTON)
End If
End If
End Function
Public Shared Sub ShowTaskBar()
SetTaskBarEnabled(True)
SetTaskbarVisible(True)
End Sub
Public Shared Sub HideTaskBar()
SetTaskbarVisible(False)
SetTaskBarEnabled(False)
End Sub
Public Shared Sub ShowSIP()
SetSIPVisible(True)
End Sub
Public Shared Sub HideSIP()
SetSIPVisible(False)
End Sub
Public Shared Sub HideStartButton()
SetStartButtonVisible(False)
End Sub
Public Shared Sub ShowStartButton()
SetStartButtonVisible(True)
End Sub
End Class