Dragobject (files) FROM VO
Posted: Tue Oct 24, 2023 10:32 am
Hi all,
since the comp.lang... group is rather dead and flooded with some Thai spam I need to bother you here:
I'm struggling for days with dragging a filename from my application to File Explorer.
Like in the SDK I use CF_HDROP. I have copied the whole code from the SDK to track down every single step. Dragging my filename array to MS WORD or inside my own application (on Windows with WS_EX_ACCEPTFILES enabled) works just fine!
But if I try to drag my files to MS File Explorer the icon stays saying "stop". Debugging reveals that all windows on the drop location (File Explorer) do NOT have WS_EX_ACCEPT_FILES enebled.
Research reveals that there are other Drag&Drop tokens like CFSTR_FILECONTENTS, but they seem only to be working as in WIndows 10 or above. VO SDK uses an undocumented funtion DragObject from USER32.DLL (especially the 3rd parameter 8003 could be some kind of helpful flag, but I don't get any clue about it). I suppose that either the content token (CF_HDROP) or these flags might be responsible for the behaviour of the drag functionality.
The Drag mechanism in itself DOES work and it aligns with all earlier suggestions like CopyToClipboard. These all come down to create a WINDROP structure, filling it up with the zero-terminated fullpaths, adding the trailing zero character, passing it to the WINDROP structure and consuming that from the StartDrag method (or something similar).
But why does the icon go to "blocked" over applications like file explorer (thus also preventing the StartDrag method from accepting targets which do NOT have WS_EX_ACCEPTFILES) - and can someone point me to another working approach to build a drag which drops files on THESE targets as well?
since the comp.lang... group is rather dead and flooded with some Thai spam I need to bother you here:
I'm struggling for days with dragging a filename from my application to File Explorer.
Like in the SDK I use CF_HDROP. I have copied the whole code from the SDK to track down every single step. Dragging my filename array to MS WORD or inside my own application (on Windows with WS_EX_ACCEPTFILES enabled) works just fine!
But if I try to drag my files to MS File Explorer the icon stays saying "stop". Debugging reveals that all windows on the drop location (File Explorer) do NOT have WS_EX_ACCEPT_FILES enebled.
Research reveals that there are other Drag&Drop tokens like CFSTR_FILECONTENTS, but they seem only to be working as in WIndows 10 or above. VO SDK uses an undocumented funtion DragObject from USER32.DLL (especially the 3rd parameter 8003 could be some kind of helpful flag, but I don't get any clue about it). I suppose that either the content token (CF_HDROP) or these flags might be responsible for the behaviour of the drag functionality.
The Drag mechanism in itself DOES work and it aligns with all earlier suggestions like CopyToClipboard. These all come down to create a WINDROP structure, filling it up with the zero-terminated fullpaths, adding the trailing zero character, passing it to the WINDROP structure and consuming that from the StartDrag method (or something similar).
But why does the icon go to "blocked" over applications like file explorer (thus also preventing the StartDrag method from accepting targets which do NOT have WS_EX_ACCEPTFILES) - and can someone point me to another working approach to build a drag which drops files on THESE targets as well?