网语飘飘.Net/Delphi攻坚战

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::
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;

posted on 2006-05-30 17:28  网语飘飘  阅读(211)  评论(0)    收藏  举报