Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Solved)...dialog size limit
#1

How can I make my Dialog have size limits, so that a user could not make the Dialog smaller than lets say w 400 h 200.
#2
Example function Dialog33
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("Dialog33" &Dialog33)) ret

;BEGIN DIALOG
;0 "" 0x90CC0A44 0x100 0 0 222 134 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2020100 "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
,;--- insert this ---
,case WM_SIZING
,RECT* r=+lParam
,if(r.right-r.left<400) r.right=r.left+400
,if(r.bottom-r.top<200) r.bottom=r.top+200
,ret DT_Ret(hDlg 1)
,;-------------------
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

WM_SIZING and other windows messages are documented in the MSDN library on the internet.
#3

Thank you Smile.


Forum Jump:


Users browsing this thread: 1 Guest(s)