How can I change the *type* of the Windows clipboard contents without changing the clipboard data?

1

I have a program in which I managed to copy content as PDF to the clipboard using some undocumented functionality. Unfortunately this data is note pasteable even to programs that accept PDF. I managed to use this program to find that it can be made pasteable by changing the description (or type) from "PDF" to "Portable Document Format" (see screenshot below). Unfortunately this program also corrupts the data when doing this. (I think this is because the data is binary and not text)

How can I change the description/type of the Windows clipboard data without changing the (binary) data itself?

Mathematica graphics

My previous related question: How to access raw clipboard data on Windows?

Szabolcs

Posted 2012-01-14T16:28:40.803

Reputation: 2 248

1" using some undocumented functionality" --- there's a reason why it's undocumented Snd you're seeing the effects of it – Sathyajith Bhat – 2012-01-15T02:31:51.833

@Sathya What is wrong with trying to reverse engineer how the program works? Also, my question is not about that functionality, but about how the clipboard works. – Szabolcs – 2012-01-15T07:55:35.803

Answers

1

It’s not possible. Data in the clipboard are OLE objects.

kinokijuf

Posted 2012-01-14T16:28:40.803

Reputation: 7 734

2I am not familiar with OLE objects. Can you elaborate and explain why it's not possible to retrieve the binary data and re-insert it to the clipboard using a different type? In this case it seems the clipboard contents are simply the contents of a PDF file. This program I mentioned will randomly not display the contents properly (see the empty screenshot) event though it does say the size of the data. I need to reinsert this data into the clipboard and call it Portable Document Format rather than PDF. – Szabolcs – 2012-01-14T17:17:53.687