landrix / The-Drag-and-Drop-Component-Suite-for-Delphi

MIT License
161 stars 57 forks source link

When a file is dragged from within 7-zip to my target, TDropPIDLTarget returns parent folder PIDL instead of item PIDL #69

Closed LihemdiRachid closed 1 year ago

LihemdiRachid commented 1 year ago
  1. Open an archive with 7-zip.
  2. Drag an item from 7-zip to your target control.
  3. 7-zip will create a temp folder with the file
  4. The TDropPIDLTarget will contain the PIDL of the temp folder instead of the item dragged.

The same scenario with TDropFileTarget returns the path of the item.

below picture shows the full path of the dragged item with TDropFileTarget (Demo project "DragDropUnicode") image

this second picture shows the issue with TDropPIDLTarget (Demo project "PIDLDemo"), it dropped the parent folder and the file is inside it (the name of the folder differs, being a new drag drop session) image

LihemdiRachid commented 1 year ago

I noticed that it's different depending on the GetDataOnEnter property. If False, the correct path is returned, if True, the parent folder's path is returned. And this has the same impact on TDropFileTarget and TDropPIDLTarget. On the examples in the previous post, DragDropUnicode had GetDataOnEnter = False. If swithed, the same symptom appears

LihemdiRachid commented 1 year ago

Got it! It's not a bug at all. It's because at DragEnter, 7-zip doesn't have extracted the file yet. 7-zip extracts the file at Drop. So GetDataOnEnter can't work fine with 7-zip