Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10 Uses Example#1 method
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
#Resource "gbsnippets.pbr"
Global hDlg,hBMP As Dword, cSize As Long
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
cSize = captionSize
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local ddw,ddh As Long
Select Case Cb.Msg
Case %WM_GETMINMAXINFO
Dialog Get Size hDlg To ddw,ddh
Local MM As MINMAXINFO Ptr
MM=Cb.LParam
@MM.ptMinTrackSize.y=ddw+cSize '<-- Min Y size of your window
@MM.ptMaxTrackSize.y=ddw+cSize '<-- Max Y size of your window
Case %WM_Size
Dialog Get Client hDlg To ddw,ddh
Dialog Set Text hDlg, Str$(ddw) + Str$(ddh)
End Select
End Function
Function captionSize() As Long
Local cw,ch,ddw,ddh As Long
Dialog Get Size hDlg To ddw,ddh
Dialog Get Client hDlg To cw,ch
Function = (ddh-ch)
End Function
'gbs_00891
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm