IsZoomed Function

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.

hwnd
A handle to the window to find whether it is maximized or not.

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.


Go to Paul Kuliniewicz's Home Page.
E-mail: rogue953@hotmail.com
This page is at http://skyscraper.fortunecity.com/transmission/45/api/i/iszoomed.html