看下错在哪里,该怎么处理
看下错在哪里
procedure SetMessageTrappingHook; stdcall;
var
TheHandle : HWND;
TheThread : DWORD;
begin
TheHandle := FindWindow( 'Whatever ',NIL);
if TheHandle <> 0 then begin
TheThread := GetWindowThreadProcessId(TheHandle,NIL);
HookProcHandle := SetWindowsHookEx(WH_CALLWNDPROC,@CallWndProc,
HInstance,TheThread);
if HookProcHandle <> 0 then
NewMessages:=0;
else
ShowMessage( 'Setting Hook Failed. ');
end else
showmessage( 'Icon Author is not currently running. ');
end;
1:请问这是个过程?还是函数?
2:如何调用?
3:调用的时候“HookProcHandle” 提示错误
------解决方案--------------------
1.过程;
2.直接输入SetMessageTrappingHook;就可调用;
3.“HookProcHandle”提示错误,怀疑是没有找到你想挂上WH_CALLWNDPROC钩子的 'Whatever '窗体。
procedure SetMessageTrappingHook; stdcall;
var
TheHandle : HWND;
TheThread : DWORD;
begin
TheHandle := FindWindow( 'Whatever ',NIL);
if TheHandle <> 0 then begin
TheThread := GetWindowThreadProcessId(TheHandle,NIL);
HookProcHandle := SetWindowsHookEx(WH_CALLWNDPROC,@CallWndProc,
HInstance,TheThread);
if HookProcHandle <> 0 then
NewMessages:=0;
else
ShowMessage( 'Setting Hook Failed. ');
end else
showmessage( 'Icon Author is not currently running. ');
end;
1:请问这是个过程?还是函数?
2:如何调用?
3:调用的时候“HookProcHandle” 提示错误
------解决方案--------------------
1.过程;
2.直接输入SetMessageTrappingHook;就可调用;
3.“HookProcHandle”提示错误,怀疑是没有找到你想挂上WH_CALLWNDPROC钩子的 'Whatever '窗体。