[python-win32] CF_ENHMETAFILE SetClipboardData 'The handle is invalid'

RuiDC ruidc at yahoo.com
Wed Aug 17 17:02:32 CEST 2011


import win32clipboard

filename = r"C:\tmp\test.emf"
with open(filename, "rb") as f:
    data = f.read()
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(win32clipboard.CF_ENHMETAFILE, data) 
win32clipboard.CloseClipboard()

why do I get the below message?

pywintypes.error: (6, 'SetClipboardData', 'The handle is invalid.')
-- 
View this message in context: http://old.nabble.com/CF_ENHMETAFILE-SetClipboardData-%27The-handle-is-invalid%27-tp32280484p32280484.html
Sent from the Python - python-win32 mailing list archive at Nabble.com.



More information about the python-win32 mailing list