I've created a Clipboard viewer in the standard suggested way editing the WndProc as follows.
case WM_DRAWCLIPBOARD:
Logger.Main.LogMessage("Draw Clipboard event");
if (OnClipboardChanged != null) {
OnClipboardChanged(this, new ViewChangeEventArgs());
}
WindowAPI.SendMessage(NextClipboardViewer, m.Msg, m.WParam, m.LParam);
break;
case WM_CHANGECBCHAIN:
Logger.Main.LogMessage("Change CB Chain");
if (m.WParam == NextClipboardViewer) {
NextClipboardViewer = m.LParam;
}
else {
WindowAPI.SendMessage(NextClipboardViewer, m.Msg, m.WParam, m.LParam);
}
break;
My application need just to be notified when new data is available in the clipboard. Things work fine and the messages are properly detected.
Sometimes (and this is very hard to reproduce) I receive a big number of WM_DRAWCLIPBOARD generated events generated with the same timestamp, associated with the same data in the clipboard. Any idea of what could cause this? Any suggestions on how to get more information about those messages?
Thanks.