For a small utility I am writing (.NET, C#), I want to monitor clipboard copy operations and clipboard paste operations.
My idea is to provide my own data when pasting into an arbitrary application.
The monitoring of a copy operation can be easily done by using a clipboard viewer.
Something that seems much more advanced to me is to write a "clipboard paste provider":
I found this posting and this posting, but none of them seems to really help me.
What I guess is that I somehow have to mimic/hijack the current clipboard.
Question:
Is it possible to "wrap" the clipboard in terms of paste operations and provide my own kind of "clipboard proxy"?
You need to hook in the clipboard hook by using a windows hook. A windows hook is a way of intercepting global events happening and providing your own hook procedure to replace or intercept the message. Have a look here on CodeProject that explains how to hook. Here's a clipboard helper that listens for the copy/paste functionality. Here's a Clipboard spy that just does that. Here's another article that implements a Clipboard hook.