07-15-2005, 10:01 AM
Sample dialog (function dialog_with_updown):
Function InitUpDownControl:
All Windows controls are documented in the MSDN Library.
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str e3
if(!ShowDialog("dialog_with_updown" &dialog_with_updown &controls)) ret
;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 223 135 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Edit 0x54030080 0x204 34 26 16 14 ""
;4 msctls_updown32 0x54000002 0x4 50 26 11 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010703 "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam)
,
,InitUpDownControl id(4 hDlg) id(3 hDlg) 0 100 0
,
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1Function InitUpDownControl:
;/
function hwndUpdown hwndBuddy rangeMin rangeMax [position]
;Initializes up-down control (msctls_updown32).
;Call from dialog procedure, under WM_INITDIALOG.
;Also, include 2 in msctls_updown32 style in dialog definition (eg change 0x54000000 to 0x54000002).
def UDS_SETBUDDYINT 0x0002
def UDM_SETBUDDY (WM_USER+105)
def UDM_SETRANGE32 (WM_USER+111)
def UDM_SETPOS32 (WM_USER+113)
SendMessage hwndUpdown UDM_SETBUDDY hwndBuddy 0
SendMessage hwndUpdown UDM_SETRANGE32 rangeMin rangeMax
SendMessage hwndUpdown UDM_SETPOS32 0 positionAll Windows controls are documented in the MSDN Library.
