Mészáros,
Once you get the implementation of IDataObject, you should be able to
call GetFormats to get all the formats that are on the clipboard. Once you
have those, cycle through them, and get the data, and store it somewhere.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"Mészáros Tamás" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi!
>
> Can I save and restore the content of the clipboard without dealing with
> the format it stores? I use the clipboard for data exchange between
> applications (this is the only way), and I would like to keep the previous
> content of the clipboard. Any examples I've found build on the format of
> the data, but I can't now in advance, what type of data on the clipboard
> will be. I can't even save and restore a part of simple formatted text
> copied from winword. If I choose text format, I get unformatted text back.
> If I choose Rich Text Format, I get the rtf formatting text (eg.
> "{\rtf1\ansi\ansicpg1250\uc1\deff0\" ..., but not the formatted text.
>
> IDataObject ido = Clipboard.GetDataObject();
> object savedData = ido.GetData(DataFormats.Rtf, true);
> ...Using clipboard for data exchange
> Clipboard.SetDataObject(savedData, true);
>
> And what if there is a bitmap or other kind of data on the clipboard? How
> could I save and restore them?
>
> Could someone send me a link where I could find solution for my problem,
> or tell me what I could do?
>
> Thank's
>
> Tamas Meszaros