CAPIHook剪贴板对SetClipboardData和GetClipboardData的挂接失败 [英] CAPIHook Clipboard hooking fails for SetClipboardData and GetClipboardData
问题描述
我正在使用jeffrey richters的示例22 LastMsgBoxInfoLib,将其修改为挂钩User32.dll的SetClipboardData和GetClipboardData函数.但是挂接过程失败.我的想法是以下调用不正确.
g_hhook = SetWindowsHookEx(WH_GETMESSAGE,GetMsgProc,
ModuleFromAddress(LastMsgBoxInfo_HookAllApps),dwThreadId);
我传递给上述SetWindowsHookEx的前两个参数应该是什么,以便可以捕获剪贴板事件并复制粘贴命令?
谢谢
Bikram ...
Hi,
I am using jeffrey richters''s example 22 LastMsgBoxInfoLib, modified to hook User32.dll''s SetClipboardData and GetClipboardData functions. But the hooking process fails. My idea is that the following call is not correct.
g_hhook = SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc,
ModuleFromAddress(LastMsgBoxInfo_HookAllApps), dwThreadId);
What should be first two parameters, that I pass to the above mentioned SetWindowsHookEx, so that I can capture clipboard events and copy paste commands?
Thanks
Bikram...
推荐答案
从 ^ ].您输入的第一个参数是正确的,最后两个参数取决于您要在何处处理消息,请参阅这些参数的说明和说明.NULL
的两个参数是最常用的.
您捕获了WH_GETMESSAGE
,并且消息将通过您要安装的消息挂钩过程中的消息ID进行过滤.
—SA
It is clear from http://msdn.microsoft.com/en-us/library/ms644990(v=vs.85).aspx[^]. Your first to parameters are correct, the last two parameter depend on where you want to handle the message, please see explanation of these parameters and remarks. Both parameters ofNULL
is the most usual use.
You captureWH_GETMESSAGE
, and the messages will be filtered by the message IDs in your message hook procedure you''re installing.
—SA
SAKryukov,
我能够使其正常运行,但最终却是一个愚蠢的错误,
我用错误的参数声明了挂钩函数,
(HANDLE hMem,UINT uFormat)而不是
(UINT uFormat,HANDLE hMem).
问候
比克拉姆...
Hi SAKryukov,
I was able to get it working, it was a silly mistake at my end,
I declared the hooking function with wrong parameters,
(HANDLE hMem, UINT uFormat) instead of
(UINT uFormat ,HANDLE hMem).
Regards
Bikram...
这篇关于CAPIHook剪贴板对SetClipboardData和GetClipboardData的挂接失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!