WindowState of a form

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hi,
I write code to resize controls corresp. to Form_resize.
When the form is minimized, the controls will not be resized.
But I don't know, how I can retrieve the windowstate of a form, when it is
mininmized or maximized or normally resized.

Thanks for help
Martins
 
Hi Martin

You can declare a couple of API functions as follows:

Public Declare Function IsMaximized Lib "user32" _
Alias "IsZoomed" _
(ByVal hWnd As Long) _
As Long

Public Declare Function IsMinimized Lib "user32" _
Alias "IsIconic" _
(ByVal hWnd As Long) _
As Long

To use:
If IsMaximized(Me.hWnd) then...
 
Thanks

Graham Mandeno said:
Hi Martin

You can declare a couple of API functions as follows:

Public Declare Function IsMaximized Lib "user32" _
Alias "IsZoomed" _
(ByVal hWnd As Long) _
As Long

Public Declare Function IsMinimized Lib "user32" _
Alias "IsIconic" _
(ByVal hWnd As Long) _
As Long

To use:
If IsMaximized(Me.hWnd) then...

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Martin said:
Hi,
I write code to resize controls corresp. to Form_resize.
When the form is minimized, the controls will not be resized.
But I don't know, how I can retrieve the windowstate of a form, when it is
mininmized or maximized or normally resized.

Thanks for help
Martins
 
Back
Top