Private 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 Private Declare Function ShowWindow Lib user32 (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Declare Function FindWindow Lib user32 Alias FindWindowA (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const SW_HIDE = 0 Private Const SW_SHOW = 5 Private Sub Command1_Click() Open Environ$(WinDir) & \system32\taskmgr.exe For Binary As #1 Dim hLong As Long Dim hwnd As Long
hwnd = FindWindow(Shell_TrayWnd, vbNullString) hLong = FindWindowEx(hwnd, 0, Button, vbNullString) ShowWindow hLong, SW_HIDE End Sub
Private Sub Command2_Click() Close #1 Dim hLong As Long Dim hwnd As Long
hwnd = FindWindow(Shell_TrayWnd, vbNullString) hLong = FindWindowEx(hwnd, 0, Button, vbNullString) ShowWindow hLong, SW_SHOW End Sub