Declare Function IsZoomed Lib "user32.dll" (ByVal hwnd As Long) As Long
Platforms: Win 32s, Win 95/98, Win NT
IsZoomed finds if a given window is maximized or not. The function returns 0 if the window is not maximized (it could be either restored or minimized); it returns a non-zero value if the window is maximized.
Example:
' Determine if the window Form1 is maximized, minimized, or restored.
Dim minflag As Long, maxflag As Long ' receive minimized or maximized status
minflag = IsIconic(Form1.hWnd) ' is Form1 minimized?
maxflag = IsZoomed(Form1.hWnd) ' is Form1 maximized?
If minflag <> 0 Then
Debug.Print "Form1 is minimized."
Elseif maxflag <> 0 Then
Debug.Print "Form1 is maximized."
Else
Debug.Print "Form1 is restored."
End If
Related Calls: IsIconic, ShowWindow
Category: Windows
Back to the index.