ZTree.com  | ZEN  | About...  

 Index   Back

Also works on Win10, but ‘native’ copy-paste (CF_HDROP) would be nice   [Help!]

By: Martijn Coppoolse   Homepage   Voorburg, NL  
Date: Oct 11,2018 at 16:10
In Response to: Doesn't work here (Paul Laufer)

> It does not work here on my Windows 7 machine running ZTree x64
> v2.4.186

It works without a hitch on my Windows 10 laptop running ZTW64 v2.4.186 as well.
Very odd.

> When I Shift-F10 Copy a file here using Ztree, in Explorer the paste
> option is then greyed out.
> There is some interaction happening though because if I CTL-Copy a file
> in Explorer and then confirm in Explorer that the Paste context menu is
> active. But then as soon as I Shift-F10 Copy a file with Ztree, the paste
> option in Explorer is greyed out again.
> I've longed for this ability for many years in Ztree as I work often
> with multiple monitors displaying multiple Remote Desktop machines.
> Windows will Copy/Paste between then nicely, but I wish I could just do
> it in Ztree.

I just tried copying it to the aforementioned Windows 7 machine via Remote Desktop. Application key in ZTreeWin, Copy, then Paste in Explorer on remote machine. Again, works a treat.

Now I'm really curious what makes it work on my machines but not on yours or Peter's...

> It would be nice if Ztree had some kind of "Clipboard Inspector" that
> lets you see the logical content of the clipboard. By logical I mean the
> data type. Whether or not it's a file or a folder or a folder of files
> or a branch of folders and files. IE, it's something that can reasonably
> be expected to paste onto a directory tree... and do it.

The clipboard is capable of containing multiple different formats at the same time. Pasting in a separate application will use the first (or most specific) format supported by the target application. (Sometimes, the user gets to choose the format to paste, if more than one format present on the clipboard are supported, like Paste Special in Office).

I would really like it if ZTreeWin, when using [Ctrl-Insert], each of the 'path' options would put the relevant path in file format (CF_HDROP) as well as in text format (CF_UNICODETEXT) on the clipboard.

It's bugged me since Windows 95 that Explorer doesn't do this, too.
I know that it's possible, since I've built it into at least one application where I had a need to copy one or more files from within the application. Open the clipboard, put the file path(s) in CF_HDROP format on the clipboard, then put the file path(s) in CF_UNICODETEXT on the clipboard, then close the clipboard.
After that, pasting in Explorer would make a copy of the file; but pasting in Notepad, a console window, or a file dialog, would simply paste the file's full path.

AFAICR, this always used to copy files, never cut (aka move).

I imagine this could be built (more-or-less transparently) into the following [Ctrl-Insert] options:
* [F]ull path
* [P]arent path
* [T]agged files

Of course, the CF_HDROP should respect the following options:
- [C]ase
- [L]ong/[S]hort names
- [R]esultant path
- [U]NC
but the following options should be disregarded:
- always use [\], never /
- always use a NUL character as [D]elimiter for tagged files
- always copy [W]ith path

I'd almost advocate for always doing this double-format copy on [Ctrl-Insert], but it could potentially spell trouble when pasting into an application that supports both pasting of files and of text. Like Microsoft Word, for example. This could mean yet another option, to choose between "text", "file objects", or "both". Or, as a workaround, ZTreeWin's help could specify that in such a situation, pasting into Notepad (or some such app), and copying again from there, would get rid of the 'files' on the clipboard while maintaining the textual paths.

A final consideration: pasting files or folders from the clipboard seems more difficult to fit into ZTreeWin. Nor do I see the need, to be frank, aside from "being complete".


Thread locked

Messages in this Thread

95,044 Postings in 11,981 Threads, 349 registered users, 26 users online (0 registered, 26 guests)
Index | Admin contact |   Forum Time: Jul 8, 2020 - 10:52 am EDT  |  Hits:32,024,575  (15,559 Today )
RSS Feed