IsIconic Function

Declare Function IsIconic Lib "user32.dll" (ByVal hwnd As Long) As Long

Platforms: Win 32s, Win 95/98, Win NT

IsIconic finds if a given window is minimized or not. The function returns 0 if the window is not minimized (it could be either restored or maximized); it returns a non-zero value if the window is minimized.

hwnd
A handle to the window to find whether it is minimized 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

See Also: IsZoomed, ShowWindow
Category: Windows

Go back to the alphabetical Function listing.
Go back to the Reference section index.


This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/i/isiconic.html