Für dieses Beispiel benötigen Sie eine Form und zwei CommandButtons (Command1 und Command2).
Option Explicit
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
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 Const SWP_SHOWWINDOW = &H40
Private Const SWP_HIDEWINDOW = &H80
Private Sub Command1_Click()
'ausblenden
Dim lWnd As Long
lWnd = FindWindow("Shell_TrayWnd", "")
SetWindowPos lWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW
End Sub
Private Sub Command2_Click()
' einblenden
Dim lWnd As Long
lWnd = FindWindow("Shell_TrayWnd", "")
SetWindowPos lWnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW
End Sub
Private Sub Form_Load()
'initialisieren
Command1.Move 120, 120, 1695, 375
Command1.Caption = "Ausblenden"
Command2.Move 120, 600, 1695, 375
Command2.Caption = "Einblenden"
End Sub