2

我知道如何编写和使用 Windows 挂钩 DLL 来捕获窗口上的窗口消息等内容。我需要做的是在任何应用程序中捕获在系统上完成的任何副本(Control+C 或其他方法)。有没有一种使用 windows 挂钩的快速简单的方法来做到这一点?

4

1 回答 1

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.

于 2011-06-13T19:00:58.210 回答