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