01-16-2021, 05:07 AM
It's probably best in this situation to switch to a multiline edit control
then enter wont close dialog.
But for future reference to prevent dialog from closing when enter key is pressed
find IDOK and add code
so it looks like this
for the text erase problem change
to
for multiline edit control
use this code
then enter wont close dialog.
But for future reference to prevent dialog from closing when enter key is pressed
find IDOK and add code
so it looks like this
for the text erase problem change
to
for multiline edit control
use this code
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x8 0 0 352 220 "Dialog" "4"
;3 Edit 0x54231044 0x200 12 8 330 180""
;1 Button 0x54030001 0x4 244 196 48 14 "OK"
;2 Button 0x54030000 0x4 300 196 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""
str controls = "3"
str e3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
out e3
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,QmRegisterDropTarget(id(3 hDlg) hDlg 0)
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_QM_DRAGDROP
,QMDRAGDROPINFO& di=+lParam
,sel wParam
,,case 3 ;;drop
,,str s
,,if(!di.GetText(s 1)) s=di.files ;;
,,s.setsel(0 di.hwndTarget)
,,ret DT_Ret(hDlg 1)
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1