Results 1 to 4 of 4

Thread: is there a way to maximize a window that is minized to the taskbar?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    124

    is there a way to maximize a window that is minized to the taskbar?

    is there a way to maximize a window that is minimized to the taskbar?

    I do not want to do this in a VB form, I want to any windows program, that I have the windows title for.

  2. #2
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: is there a way to maximize a window that is minized to the taskbar?

    try like this
    Code:
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
        (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    
    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
        ByVal nCmdShow As Long) As Long
    
    Private Declare Function SetForegroundWindow Lib "user32.dll" (ByVal hwnd As Long) As Long
    
    Private Const SW_SHOWNORMAL = 1
    Private Const SW_SHOWMINIMIZED = 2
    Private Const SW_SHOWMAXIMIZED = 3
    
    Private Sub Command1_Click()
    Dim lHwnd As Long
    lHwnd = FindWindow("Notepad", vbNullString)
    If lHwnd <> 0 Then
        MsgBox "Notepad is opened!", vbInformation, "Notepad"
        ShowWindow lHwnd, 1
        SetForegroundWindow (lHwnd)
    Else
        MsgBox "Notepad isn't opened", vbInformation, "Window not found."
    End If
    End Sub
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    124

    Re: is there a way to maximize a window that is minized to the taskbar?

    That works well for notepad, but what about other programs?

    does the FindWindow work with a partial window name?

  4. #4
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: is there a way to maximize a window that is minized to the taskbar?

    see this link
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width