I know how put content to and retrieve content from the clipboard.
However, between these two operations, it is possible for another operation to change the content of the clipboard.
Is there a way to be notified when any application modifies the clipboard?
I know this answer is to late The only reference you need to add is to windows froms in your wpf application. I created a wrapper to the functionality I found on the internet. Most of the examples do more stuff than what I needed so I desided to create my own class. I like to isolate the problems so this class just listens when the clipboard changes and tels you the type of data that is on the clipboard. For example is it text? an image? or what?
Anyways here is my wrapper:
I know it might be to much but but after wrapping it it should look like:
And then you use the class as:
When an application calls OpenClipboard(), no other application can use the clipboard. Once the application that has locked the clipboard calls CloseClipboard(), then any application can then use and lock the clipboard.
Yes. See the API SetClipboardViewer() and the messages WM_DRAWCLIPBOARD and WM_CHANGECBCHAIN.
More info here: http://msdn.microsoft.com/en-us/library/ms649016(v=vs.85).aspx#_win32_Adding_a_Window_to_the_Clipboard_Viewer_Chain
All I could find was a Clipboard Monitor written in C#/VB.NET. I see WPF and WinForms, so I assume this is a viable options.
Involves pinvoking some methods from the user32 dll.
EDIT
At the time of edit, the original link above is broken. Here's an archive.org snapshot
Here is a write-up that I did a few years ago, detailing clipboard even monitoring via the Windows API: http://www.clipboardextender.com/developing-clipboard-aware-programs-for-windows/6 Please pay particular attention to the "common mistakes" section. Hardly anyone does this correctly the first time.