Minimize by Window Title
Use the FindWindow API function to find the window's handle. Then use the SetWindowPlacement API function to minimize it.
' Find the target window and minimize it.
Private Sub cmdMinimizeWindow_Click()
Dim app_hwnd As Long
Dim wp As WINDOWPLACEMENT
' Find the target.
app_hwnd = FindWindow(vbNullString, txtTargetName.Text)
' Get the window's current placement information.
wp.length = Len(wp)
GetWindowPlacement app_hwnd, wp
' Minimize the window.
wp.showCmd = SW_SHOWMINIMIZED
SetWindowPlacement app_hwnd, wp
End Sub
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.