Feb-08-2020, 12:36 PM
(Feb-08-2020, 11:51 AM)jim2007 Wrote: Your ability to do something like this would be dependent on how good your knowledge of Windows system programming is.
Basically when you copy a file to the clipboard in Explorer, it puts the necessary information there in a certain format:
https://docs.microsoft.com/en-us/windows...descriptor
Once you have mastered the details of that format, the next step would be to figure out how to access the clipboard data in Python and decode it.
Hello, Tim! Thanks for the answer, it found something there.
I managed to find this way of doing it with win32clipboard:
import win32clipboard as cb cb.OpenClipboard() if cb.IsClipboardFormatAvailable(cb.CH_HDROP): clipboard_file_path = cb.GetClipboardData(cb.CF_HDROP) print(clipboard_file_path) cb.CloseClipboard()CF_HDROP refers to clipboard data about a copied file. It will raise an exception if the format is not CF_HDROP, so you can check if it's ok with cb.IsClipboardFormatAvailable.
Thanks!