Delphi全局勾子和局部勾子
<div id="cnblogs_post_body">1.安装勾子用SetWindowsHookEx function来实现,对于这个函数先来看MSDN解释Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread. 参考MSDN
<div class="cnblogs_code">1 HHOOK WINAPI SetWindowsHookEx(2 __in int idHook,//勾子类型3 __in HOOKPROC lpfn,//回调函数的地址4 __in HINSTANCE hMod,//一般为HInstance5 __in DWORD dwThreadId,//关联进程的句柄,如果0则关联所有正在运行的进程,全局勾子时为06 );
页:
[1]