12-05-2017, 07:33 PM
How do you approach a situation where you have multiple input-fields that can receive drag/drop?
From the help-file:
Within the case "case WM_QM_DRAGDROP" you have:
s.setwintext(id(3 hDlg))
But how do you process 2 inputfields, for example inputfields with ID 3 (like you see above) and an extra one with ID 4.
If the user drags a file onto inputfield with ID 4 how can you make the code use the correct inputfield?
EDIT:
Assuming In the WM_INITDIALOG part you would have (for ID 3 and 4):
QmRegisterDropTarget(id(3 hDlg) hDlg 16)
QmRegisterDropTarget(id(4 hDlg) hDlg 16)
From the help-file:
Quote: case WM_INITDIALOG
QmRegisterDropTarget(id(3 hDlg) hDlg 16)
case WM_DESTROY
case WM_COMMAND goto messages2
case WM_QM_DRAGDROP
QMDRAGDROPINFO& di=+lParam
set edit box
str s.getl(di.files 0) ;;get first file
s.setwintext(id(3 hDlg))
to get all dropped files, you can use eg foreach. Example: foreach(s di.files) out s
Within the case "case WM_QM_DRAGDROP" you have:
s.setwintext(id(3 hDlg))
But how do you process 2 inputfields, for example inputfields with ID 3 (like you see above) and an extra one with ID 4.
If the user drags a file onto inputfield with ID 4 how can you make the code use the correct inputfield?
EDIT:
Assuming In the WM_INITDIALOG part you would have (for ID 3 and 4):
QmRegisterDropTarget(id(3 hDlg) hDlg 16)
QmRegisterDropTarget(id(4 hDlg) hDlg 16)