Undskyld, jeg manglede og så lige minimeringsdelen; du kan minimere et vindue
Du minimerer et vindue ved at bruge følgende API-kald :
Dim retval As Long
retval = ShowWindow(Hwnd, SW_MINIMIZE) ' hvor "hwnd" er vinduet s handle...
Du skal have defineret følgende :
Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
og du kan bruge følgende konstanter :
SW_HIDE = 0
Hide the window.
SW_MAXIMIZE = 3
Maximize the window.
SW_MINIMIZE = 6
Minimize the window.
SW_RESTORE = 9
Restore the window (not maximized nor minimized).
SW_SHOW = 5
Show the window.
SW_SHOWMAXIMIZED = 3
Show the window maximized.
SW_SHOWMINIMIZED = 2
Show the window minimized.
SW_SHOWMINNOACTIVE = 7
Show the window minimized but do not activate it.
SW_SHOWNA = 8
Show the window in its current state but do not activate it.
SW_SHOWNOACTIVATE = 4
Show the window in its most recent size and position but do not activate it.
SW_SHOWNORMAL = 1
Show the window and activate it (as usual).
Ellers kan du minimere ALLE vinduer på følgende måde :
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_KEYUP = &H2
Private Const VK_LWIN = &H5B
Private Sub MinimizeAll()
keybd_event VK_LWIN, 0, 0, 0
keybd_event Asc("M"), 0, 0, 0
keybd_event VK_LWIN, 0, KEYEVENTF_KEYUP, 0
End Sub