bmatumbura
asked on
Get the Min/Max State of a window
I need a VB boolean function that takes a handle to a window (hWnd as Long) as a parameter. The function then checks the Min/Max status of the Window. It must return True if the Window is Minimized, False otherwise.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Declare Function IsZoomed Lib "user32" Alias "IsZoomed" (ByVal hwnd As Long) As Long
Example:
Private Declare Function IsZoomed Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Form_Activate()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Me.AutoRedraw = True
Me.Print "Was the window maximized onstartup? " + Str$(CBool(IsZoomed(Me.hwn
Me.WindowState = vbMaximized
Me.Print "Is the window now maximized? " + Str$(CBool(IsZoomed(Me.hwn
End Sub
cheers