07-02-2015, 01:07 PM
Macro Macro2544
\Dialog_Editor
out
str dd=
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Static 0x54000103 0x20000 0 0 42 34 ""
;4 Button 0x54032000 0x0 76 8 48 14 "Auto click"
;END DIALOG
;DIALOG EDITOR: "" 0x2040300 "" "" "" ""
str controls = "3"
str si3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
int-- t_inMenu t_inButton
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,t_inMenu=0; t_inButton=0
,
,case WM_SETCURSOR
,int cid=GetDlgCtrlID(wParam)
,
,if cid=3
,,if !t_inMenu
,,,t_inMenu=1
,,,int i=ShowMenu("1one[]2two")
,,,out i
,,,t_inMenu=2
,else if(t_inMenu=2) t_inMenu=0
,
,if cid=4
,,if t_inButton=0
,,,t_inButton=1
,,,but 4 hDlg
,else t_inButton=0
,
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 4
,out "button 4"
,
,case IDOK
,case IDCANCEL
ret 1