Code:
Declare Function findwindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, ByVal _
lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As _
Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Declare Function showWindow Lib "user32" Alias "ShowWindow" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
Dim progman&
Dim shelldlldefview&
Dim syslistview&
Dim tray&
Private Sub Command1_Click()
'Hide
progman& = findwindow("progman", vbNullString)
shelldlldefview& = FindWindowEx(progman&, 0&, "shelldll_defview", vbNullString)
syslistview& = FindWindowEx(shelldlldefview&, 0&, "syslistview32", vbNullString)
tray& = findwindow("Shell_TrayWnd", vbNullString)
Y = showwindow(syslistview&, SW_HIDE)
X = showwindow(tray&, SW_HIDE)
End Sub
Private Sub Command2_Click()
'Show
progman& = findwindow("progman", vbNullString)
shelldlldefview& = FindWindowEx(progman&, 0&, "shelldll_defview", vbNullString)
syslistview& = FindWindowEx(shelldlldefview&, 0&, "syslistview32", vbNullString)
tray& = findwindow("Shell_TrayWnd", vbNullString)
Y = showwindow(syslistview&, SW_SHOW)
X = showwindow(tray&, SW_SHOW)
End Sub