Store clipboard data

G

Guest

My app has to temporarily use the clipboard - and while doing so, it would
delete any existing data which the user has copied (possibly from other
applications).

What I want to do is temporarily store (if to file then by serializing) the
clipboard data, use the clipboard, and the restore the clipboard with the
temp data.

The question is: apps like Word store up to 16 different formats at once on
the clipboard - how do I deal with that? If it was just text, image, audio, I
could store it appropriately, but how to store custom data formats?

Any help would be greatly appreciated.

Thanks,
Dax
 
D

Derek Davidson

Nukeation said:
Any help would be greatly appreciated.

I'd refer you to the clipboard class in the .NET framework and the
GetDataObject and SetDataObject methods.

From the VS 2003 help:

"Because the data type of the object returned from the clipboard can
vary, (GetDataObject) returns the data in an IDataObject. Then you can
use methods of the IDataObject interface to extract the data in its
proper data type."

Hope that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top