Was trying to use win32clipboard to do the copy paste operations for text (till now), and was able to do it with 开发者_JAVA技巧ease.But now am wondering how does the copy/paste operations would be accomplished for folders/files etc through that. I am using python to achieve the same. Could not also find any relevant formats for that. Is it something like file path gets copied and then paste operation identifies clipboard data as file path and then actually does the file copy? No clue :(.
Windows copy/paste stores things as OLE objects (http://en.wikipedia.org/wiki/Object_Linking_and_Embedding) You need a python package to deal with OLE. This thread might help- How do I script an OLE component using Python?
When you copy a shell object (e.g. a file or a folder) to the clipboard, the shell places data into the clipboard in a variety of different formats. The clipboard viewer for such an operation shows the following formats:
I honestly don't know which one is used when you subsequently paste, but my guess would be the Shell IDList Array
. The point is that the files and folders don't go into the clipboard, only references to them.
I believe that there is comprehensive documentation of this on MSDN: Shell Clipboard Formats.
That should give you enough orientation to conduct a further web search for Python wrappers to such functionality (I'm sure they will exist)!
精彩评论