Windows – Clipboard content automatically erased

clipboardcopy/pastewindowswindows 7

My clipboard gets automatically erased from time to time.

For example:
I copy some text using Ctrl+C, and then paste it somewhere. And when I try to paste it again, nothing happens. I need to copy it once again.

This happens irregulary, sometimes I'm able to paste the text for many times, sometimes not even once.

I'm a developer, so I copy & paste very often (…), but this is really annoying.

How can I discover, which software does this? Is there any tool for monitoring WHICH PROCESS ERASED CLIPBOARD? Or if you experienced this problem with any software you've used, which one was that?

I'm using Windows 7, and many applications are running on my system, so it is hard to tell which one is causing all the trouble.

Update

Today I've confirmed that the misbehaving application is Visual C# 2010, and the problem is appearing only inside this application. I've tried to clipboard-monitoring tools as JRobert suggested. It seems that the text is correctly copied into the clipboard (so the clipboard history manager can record it) and then the Visual C# 2010 erases the clipboard content for some reason, which leads into "empty clipboard".

So thank you all, I'm now sure which application causes the trouble, and have even found Microsoft Connect bug tracker about this:
https://connect.microsoft.com/VisualStudio/feedback/details/554039/visual-studio-2010-clipboard-copy-and-cut-does-not-work?wa=wsignin1.0
And here is some additional info:
http://alpascual.com/post/copy-and-paste-problems-in-visual-studio-2010.aspx

Now I can just wait and pray for Microsoft to fix the bug.

Best Answer

Check out https://stackoverflow.com/questions/621577/clipboard-event-c

I don't think you can do more than there is available with the API, but this should be helpful enough to roll up your own Clipboard Monitor or request someone from that question to provide you theirs. Monitoring and showing the contents of the clipboard each time can be helpful whether to decide if something third-party is messing with your clipboard, from there you will have to identify the culprit by eliminating processes or something like that.

Related Question