How files get copy / cut / paste using clipboard operations (ctrl-c / ctrl-v)

tried to use win32clipboard to perform paste copy operations for text (so far) and was able to do this with ease. But now it’s interesting how copy / paste operations will be performed for folders / files, etc. what. I use python to achieve the same. Could not find the appropriate formats. It looks like the file path is copied and then the paste operation identifies the clipboard data as the file path and then actually copies the file? No hint :(.

+2
python copy-paste winapi pywin32
source share
2 answers

Windows copy / paste stores objects as OLE objects ( http://en.wikipedia.org/wiki/Object_Linking_and_Embedding ) You need a python package to work with OLE. This thread can help - How is a script OLE component using Python?

0
source share

When you copy a shell object (such as a file or folder) to the clipboard, the shell places data on the clipboard in various formats. The clipboard viewer for such an operation displays the following formats:

enter image description here

I honestly don't know which one is used when you subsequently insert, but I assume that it will be a Shell IDList Array . The fact is that files and folders do not get to the clipboard, but only links to them.

I believe there is full documentation on this on MSDN: clipboard formats.

This should give you enough orientation to further search the web for Python shells for such functionality (I'm sure they will exist)!

0
source share

All Articles