How to access DataObject retrieved from win32clipboard?

dominikush dominikush at yahoo.com
Thu Mar 14 06:48:45 EST 2002


Hi,

I copied some graphical elements from Powerpoint to the clipboard.
My aim is to convert the clipboard data to png and store the image
in a file. The problem is that I retrieve a DataObject from 
win32clipboard and I do not understand how to continue from there.
Can somebody help me out here?

>>> import win32clipboard
>>> win32clipboard.OpenClipboard(0)
>>> win32clipboard.EnumClipboardFormats(0)
49161

A strange data format. So, let's find out what it is:

>>> win32clipboard.GetClipboardFormatName(49161)
'DataObject'

So, let's try to get the `DataObject' from the clipboard:

>>> data = win32clipboard.GetClipboardData(49161)
>>> data
'\xb8\x02\x05\x00'

Ups, what's this? Looks like an identifier/handle to `DataObject'.
But where's the object? How do I resolve the identifier? Any
suggestions?

Best regards,

Dominikus





More information about the Python-list mailing list