Save & Restore ENTIRE Clipboard

Started by fhammer, January 05, 2016, 04:58:00 PM

Previous topic - Next topic

fhammer

Is there a way to save the ENTIRE ckipboard at the start of a program, then restore the ENTIRE clipboard prior to exiting?

I'm not just referring to text and not just a specific format. I use the clipboard for various things in my programs. However, it would be nice if the user could rely on clipboard contents being the same as before the program was invoked.

The standard clipboard functions don't appear to do the trick, as they are format-specific. BinaryClipPut for example, only resores one format, and appears to destroy the other formats. Thus, even multiple sequential calls, with different (saved) formats, would not restore all formats.

Also, is there a tech paper on Clipboard management?

Thanks

td

Sound a bit like your programs are not following recommend standards for using the clipboard, if you feel you need to restore user content.  MFST documentation states that  "The clipboard is user-driven. A window should transfer data to or from the clipboard only in response to a command from the user."

Also MSFT states that "To place information on the clipboard, a window first clears any previous clipboard content ."  The BinaryClipPut function follows the MSFT recommend  practice for placing information on the clipboard.

If you wish find out more about the clipboard and its proper usage, use your search engine of choice to find the clipboard Win32 function documentation on MSFT's MSDN Website (Google "clipboard site:microsoft.com" sans double quotes.)

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade