02-11-2023, 08:42 AM
#3 and #4
Macro Macro5
Macro Macro5
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54221044 0x200 8 8 208 100 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""
str controls = "3"
str e3
e3=
;hello
;world
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,QmRegisterDropTarget(id(3 hDlg) hDlg 0)
,DT_SetAccelerators(hDlg "401 Ca")
,case WM_DESTROY
,case WM_COMMAND goto messages2
,
,case WM_QM_DRAGDROP
,QMDRAGDROPINFO& di=+lParam
,;sel wParam
,,;case 3 ;;drop
,,_s=di.files; _s+"[]"
,,ifk(C) ;; Ctrl
,,,_s.setwintext(di.hwndTarget) ;;B: Delete before add
,,else
,,,_s.setsel(0 di.hwndTarget) ;;A: append
,,ret DT_Ret(hDlg 1)
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 401 ;;Ctrl+A
,PostMessage(id(3 hDlg) EM_SETSEL, 0, -1)
ret 1