I know how to write and use windows hook DLLs to capture things such as window messages on a window. What I need to do is capture any copy (Control+C or other method) done on the system in any application. Is there a quick simple way to do this using windows hooks?
Asked
Active
Viewed 4,718 times
2
-
Are you after keyboard events, or clipboard events? They're two different things. – Chris Eberle Jun 13 '11 at 18:43
1 Answers
6
You're looking for the SetClipboardViewer function.
Anytime the clipboard contents change, the most recent window to have been registered via this function (or the related ChangeClipboardChain) will receive a WM_DRAWCLIPBOARD message.
Its an applications responsibility to pass the message down the chain for to other registered viewers, as well as to un-register itself during shutdown.
This will be much more reliable than trying to hook ctrl+c.

Kevin Montrose
- 22,191
- 9
- 88
- 137