Page 1 of 1

Cannot 'Paste Shortcut' in Win Explorer after XY custom copy

Posted: 15 Nov 2013 04:16
by haddy
Hi,

Im noticing with XYplorer that I cannot 'Paste Shortcut' of a copied file/folder into Windows Explorer if that copy of the file/folder was copied from XYplorer while XY's "custom copy" module is enabled

I mainly Paste Shortcuts of folders.

Is this a known issue?

Re: Cannot 'Paste Shortcut' in Win Explorer after XY custom

Posted: 15 Nov 2013 09:41
by admin
Not sure I understand. You are talking about paste from clipboard, right? But "custom copy" has nothing to do with the clipboard. :?

Re: Cannot 'Paste Shortcut' in Win Explorer after XY custom

Posted: 21 Nov 2013 02:24
by haddy
admin wrote:Not sure I understand. You are talking about paste from clipboard, right? But "custom copy" has nothing to do with the clipboard. :?
Yes, indeed paste from clipboard into a Windows Explorer folder (after doing the Copy of file from XYplorer)

Image

here's a reproduction:

1.) Run latest version (v13.xx) of XYplorer with default 'clean' settings
2.) Go to "My Documents" folder (which is one of the default first install folder tab)
3.) Copy just one file (any file will be ok for this test)
4.) Now minimize XYplorer....
5.) ...In Windows, open any existing folder...
6.) ...Now attempt to do a "Paste Shortcut" of the file that was copied and it is blocked

Copying and then pasting a "Paste Shortcut" of a file works just fine/normal when all done within Windows Explorer, but apparently when the file copy has been made from XYplorer it does not work.

I'm running Windows 7. Thanks for reading Mr Lessau, my fingers crossed it can be investigated

Re: Cannot 'Paste Shortcut' in Win Explorer after XY custom

Posted: 21 Nov 2013 10:48
by admin
Confirmed. I think I have to call this a "known issue", a euphemism for "cannot fix it".

Workaround: Right-mouse drag-drop from XY to WE does offer the "create shortcut" command.

Re: Cannot 'Paste Shortcut' in Win Explorer after XY custom

Posted: 21 Nov 2013 17:11
by TheQwerty
admin wrote:Confirmed. I think I have to call this a "known issue", a euphemism for "cannot fix it".
:shock: As this is s rare occurrence, I became intrigued. :P


Using http://www.freeclipboardviewer.com/ I compared clipboard data when copying from XY and WE, and one difference caught my eye. I noticed that WE set Preferred DropEffect to 5 while XY set it to 1.

Being not that familiar with these parts Google led me to .NET's DragDropEffects enum which I hoped was closely related. Using a small test program showed that, at least in .NET, 1 equals Copy, 5 equals 1 OR 4, and 4 equals Link. Hmmm... :idea:

Back in FreeClipboardViewer I saved the results of an XY copy.

I opened the cl7 file, was dismayed that it was all binary, but at the end was "0100 0000" which corresponded with the hex of Preferred DropEffect. Taking a stab in the dark I tried changing it to "0400 0000". Loaded the new file in FCV, went to Explorer, right-clicked...
screenshot.1.png
Paste is disabled but Paste as Shortcut is enabled - and it works too!

I went back and changed the cl7 file to "0500 0000", rinsed and repeated...
screenshot.2.png
Success all the pastes work!


I didn't have much luck in my initial searching for DropEffect but this eventually led me to a VB6 example of setting CFSTR_PREFERREDDROPEFFECT and the enumeration DROPEFFECT.


Granted, maybe you knew all of this Don, and if so I'm sorry for wasting your time, but if not...
Have you tried registering the CFSTR_PREFERREDDROPEFFECT clipboard format with the DROPEFFECT_LINK flag set?


---------------

Also, just to add a couple more workarounds if Don cannot fix it...
Workaround 2. Right-Clicking the file in XY and selecting Create Shortcut or select File > File Special > Create Shortcut(s) will give you a shortcut that you can then move/cut & paste where you want.

Workaround 3. After copying from XY you could also right-click in Explorer, select New > Shortcut, paste the path into the Create Shortcut dialog, and click next a few times.

Joke Workaround 4. After copying from XY you could use FreeClipboardViewer to save the cl7 file, use a text editor to modify the value of Preferred DropEffect from "0100 0000" to "0500 0000", wish you modified the correct instance, load the modified cl7, and then attempt to Paste Shortcut in Explorer. ;)

Re: Cannot 'Paste Shortcut' in Win Explorer after XY custom

Posted: 21 Nov 2013 17:53
by admin
:beer: :beer: :beer: You nailed it!!! :beer: :beer: :beer:

Brilliant, thanks! :appl:

Re: Cannot 'Paste Shortcut' in Win Explorer after XY custom

Posted: 21 Nov 2013 18:15
by admin
BTW, last time I tried it with the DROPEFFECT_LINK flag set was 20071216, and then it did not work for unknown reasons, at which point I gave up on this route. Well, now it works. :biggrin:

Re: Cannot 'Paste Shortcut' in Win Explorer after XY custom

Posted: 21 Nov 2013 18:44
by Enternal
Amazing TheQwerty! Now that's detective investigation! :shock:

:biggrin: :beer: :beer: :beer:

I'm glad to know that this WAS an actual problem. Encoutered it a couple times before but I thought it was me getting old and forgetting to copy (even though I'm not old :lol:)

Re: Cannot 'Paste Shortcut' in Win Explorer after XY custom

Posted: 21 Nov 2013 19:03
by TheQwerty
Confirming that Paste Shortcut works for me when copying from 13.30.0105, so hopefully haddy can say the same.

Thanks guys! I'm just glad to know I wasn't wasting everyone's time. :)

Re: Cannot 'Paste Shortcut' in Win Explorer after XY custom

Posted: 21 Nov 2013 22:53
by haddy
Fan-effin-tastic :biggrin:

A big thank you to TheQwerty for his remedy in solving this. :appl:

Iv'e just tested the BETA v13.30.0105 - 2013-11-21 18:25 - and all is well now, working, thank you. A Wonderful forum.