Nascondere la TaskBar 2

In un modulo Bas inserire:

Option Explicit

Public Const SW_HIDE As Long = 0
Public Const SW_SHOW As Long = 5
Public Declare Function FindWindow Lib "User32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function ShowWindow Lib "User32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Public Sub ShowTaskBar(Visible As Boolean)
Dim tbarhWnd As Long
tbarhWnd = FindWindow("Shell_TrayWnd", "")
If Visible = True Then
ShowWindow tbarhWnd, SW_SHOW
Else
ShowWindow tbarhWnd, SW_HIDE
End If
End Sub


In un Form inserire un CommandButton con la proprietà Caption="&Nascondi TaskBar" 

Infine inserire il seguente codice:

Option Explicit

Private Sub Command1_Click()
With Command1
If .Caption = "&Nascondi TaskBar" Then
ShowTaskBar (False)
.Caption = "&Visualizza TaskBar"
Else
ShowTaskBar (True)
.Caption = "&Nascondi TaskBar"
End If
End With
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
ShowTaskBar (True)
End Sub

Testato su: Windows 98, Windows Me, Windows 2000 Professional