Search Tools Links Login

Minimize by Window Title


Visual Basic 6, or VB Classic

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

About this post

Posted: 2020-08-30
By: vb6boy
Viewed: 200 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.