Is there a way to use the win32clipboard module to store a link to a file on the Windows clipboard in python. My goal is to insert an image in such a way as to provide transparency. If I drag the “png” file into OneNote or copy the file and then paste it into OneNote, this seems to preserve transparency. As far as I can tell, the clipboard cannot store transparent images, so it should be a link to the file.
My research shows that it may include the win32clipboard.CF_HDrop attribute, but I'm not sure.
So, just to summarize, my goal is to have some python code that I can click, and which, for example, uses a specific file on my desktop called "img.png". As a result, "img.png" is saved in the clipboard and can be pasted into other programs. In fact, the same behavior as if I myself selected a file on the desktop, right-clicked and chose Copy.
EDIT: This page seems to suggest that there is a way to use win32clipboard.CF_HDrop somehow:
http://timgolden.me.uk/pywin32-docs/win32clipboard__GetClipboardData_meth.html
It says that "CF_HDROP" is associated with a "Unicode tuple of filenames"
source
share