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;
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;

浙公网安备 33010602011771号