Date: 02-16-2022
Return to Index
created by gbSnippets
'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: (Jose Includes)
'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).
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#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
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm