在delphi中,使用WH_CALLWNDPROC钩子时,钩子回调函数是这样的:
function HookPro(iCode: Integer;wParam: WPARAM;lParam: LPARAM): LRESULT; stdcall; export;我怎样才能从iCode、wParam、lParam三个参数中得到窗口的句柄呢?以及知道系统发给窗口的消息是什么??
谢谢!!
function HookPro(iCode: Integer;wParam: WPARAM;lParam: LPARAM): LRESULT; stdcall; export;我怎样才能从iCode、wParam、lParam三个参数中得到窗口的句柄呢?以及知道系统发给窗口的消息是什么??
谢谢!!
解决方案 »
- 最快的树形结构生成算法
- 偶不明白:delphi的type中声明了:tform1:=class(form);button1:=tbutton;等,为什么却在最后又声明:var form1:=tform1,为什么不声明在t
- 一個查詢速度的問題
- 怎样处理同时按多个键的情况?
- 请问delphi里的compile和build有什么区别啊,都能产生可执行文件?
- 在使用BDE连接远端服务器时出现错误:Cannot load and IDAPI service libraay.?up有分!
- 如何根据某一标志程序动态地使控件(如菜单,工具条上的按钮)处于活动状态或非活动状态?
- 原来CSDN菜鸟多。这么简单的问题竟然没人知道??????????????????
- 登录+主窗体+MDI窗体:登录→主窗体→MDI窗体,打开MDI窗体时报错,但如果去掉登录窗体(主窗体→MDI窗体)就能够正常打开MDI窗体
- 十万火急!请问如何在在DELPHI下有什么方法可以在客户端为服务器上的SQL SERVER增加权限用户???
- 如何隐藏WORD2000的系统菜单-"文件"下的某几项?
- 谁有简单的字符串加密解密的函数源代码?
The hook procedure can examine the message; it cannot modify it. LRESULT CALLBACK CallWndProc(
int nCode, // hook code
WPARAM wParam, // current-process flag
LPARAM lParam // address of structure with message data
);
Parameters
nCode
Specifies whether the hook procedure must process the message. If nCode is HC_ACTION, the hook procedure must process the message. If nCode is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and must return the value returned by CallNextHookEx.
wParam
Specifies whether the message was sent by the current thread. If the message was sent by the current thread, it is nonzero; otherwise, it is zero.
lParam
Pointer to a CWPSTRUCT structure that contains details about the message.
CWPSTRUCT结构里有句柄和消息:
typedef struct {
LPARAM lParam;
WPARAM wParam;
UINT message;
HWND hwnd;
} CWPSTRUCT, *PCWPSTRUCT;