I read the words in the text box, simulating the keystrokes required to enlarge and copy text. When I'm done, I want the clipboard to be exactly the way I found it.
I was hoping I could do something like this:
IDataObject clipboardBackup = Clipboard.GetDataObject(); Clipboard.Clear();
But that does not work. It looks like you can go the route specifically for text, sound, images, etc., and then save them accordingly. (I think the “data object” is also specialized in my example, I was hoping it would be common.)
I would prefer not to use cases for all possible data types in the clipboard, so that they are more concise and that I never lose data regardless of format.
Any tips on capturing any and all clipboard and then restoring it?
source share