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

℡╲_俬逩灬. 提交于 2019-12-06 06:05:45
beer_monk

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)!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!