IsIconic

Category: API Functions

Date: 07-23-2010

Return to Index


 
'Determines if a windows is minimized. Often used to decide what action to take,
'such as NOT saving dimensions when a program is closed while in minimized state
'or NOT resizing controls when the dialog is minimized.
 
'Primary Code:
iResult& = IsIconic(hDlg)
 
'Compilable Example:
'In this example, the textbox IS NOT resized if the dialog has been minimized.
'This prevents the %WM_Size code from setting invalid dimensions (in this example,
'the w/h of the dialog would be set to -20 if IsIconic were not applied).
#Compile Exe
#Dim All
#Include "Win32API.inc"
Global hDlg As DWord
Function PBMain() As Long
   Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
   Control Add TextBox, hDlg, 100,"TextBox", 10,10,100,100
   Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
   Select Case CB.Msg
      Case %WM_Size
        If IsIconic(hDlg) = %False Then
           Local w as long, h as long
           Dialog Get Client hDlg TO w,h
           Control Set Size hDlg, 100, w-20, h-20
        End If
   End Select
End Function  
 
 
'gbs_00026
 


created by gbSnippets: http://www.garybeene.com