Results 1 to 3 of 3

Thread: Determining if a window is visible

  1. #1

    Thread Starter
    Member sTyLeZ's Avatar
    Join Date
    Jan 2001
    Posts
    35

    Question

    Is there an API call to determine the status of a window (like if it's minimized, hidden, maximized, etc.)? Would I be able to use the API function GetProp(hWnd, lpString), using "WindowState" as the string parameter?
    Now the world is gone I'm just one...

  2. #2
    Guest
    Use these API functions to determine whether a window is hidden, maximized, or minzimized.

    • IsWindowVisible (Visibility)
    • IsIconic (Minimized)
    • IsZoomed (Maximized)



    Code:
    Private Declare Function IsWindowVisible Lib "user32" _
    Alias "IsWindowVisible" (ByVal hwnd As Long) As Long
    
    
    Usage
    
    
    Private Sub Command1_Click()
    
        If IsWindowVisible(hWnd) Then
            Msgbox "Window is visible"
        Else
            Msgbox "Window is not visible"
        End If
    
    End Sub

    Code:
    Private Declare Function IsIconic Lib "user32" _
    Alias "IsIconic" (ByVal hwnd As Long) As Long
    
    
    Usage
    
    
    Private Sub Command1_Click()
    
        If IsIconic(hWnd) Then
            Msgbox "Window is minimzed"
        Else
            Msgbox "Window is not minimized"
        End If
    
    End Sub

    Code:
    Private Declare Function IsZoomed Lib "user32" _
    Alias "IsZoomed" (ByVal hwnd As Long) As Long
    
    
    Usage
    
    
    Private Sub Command1_Click()
    
        If IsZoomed(hWnd) Then
            Msgbox "Window is maximized"
        Else
            Msgbox "Window is not maximized"
        End If
    
    End Sub

  3. #3

    Thread Starter
    Member sTyLeZ's Avatar
    Join Date
    Jan 2001
    Posts
    35

    Thumbs up Thanks

    Now the world is gone I'm just one...

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