05-28-2004, 10:10 AM
Usually, applications store data into the clipboard in several formats. Some of them (values < 512) are standard formats. An application also can use registered formats (>32K) and private formats (512 - 1K).
Copy something, and run following code. It shows what formats currently are in the clipboard. Those with strings are registered. You can then use RegisterClipboardFormat to get numeric value.
I tried it with selected wordart object in MS Word doc. I discovered that one of formats is "GIF". Then I executed following code, and result was normal gif file.
Copy something, and run following code. It shows what formats currently are in the clipboard. Those with strings are registered. You can then use RegisterClipboardFormat to get numeric value.
dll user32
,#OpenClipboard hWnd
,#CloseClipboard
,#CountClipboardFormats
,#EnumClipboardFormats wFormat
,#GetClipboardFormatName wFormat $lpString nMaxCount
ClearOutput
int i f
str s
OpenClipboard 0
for i 0 CountClipboardFormats
,f=EnumClipboardFormats(f)
,s.fix(GetClipboardFormatName(f s s.all(100)))
,out "%i %s" f s
CloseClipboardI tried it with selected wordart object in MS Word doc. I discovered that one of formats is "GIF". Then I executed following code, and result was normal gif file.
