Delphi中利用钩子实现QQ聊天窗口的修改
etWindowText(Handle, pchar(tlQQChat));
end;
//MSN
if pos(’ - 对话’, tlQQChat)>0 then
begin
tlQQChat := AnsiReplaceStr(tlQQChat, ’ - 对话’ , ’我的文档’);
SetWindowText(Handle, pchar(tlQQChat));
end;
end;
Result :=True;
end;
//启动钩子
function EnableWheelHook: Boolean; stdcall; export;
begin
if hkQQChat=0 then
begin
hkQQChat := SetWindowsHookEx(WH_CBT, @TitleHookProc, Hinstance, 0);
Result := True;
end
else
Result := False;
end;
//卸载钩子
function DisableWheelHook: Boolean; stdcall; export;
begin
if hkQQChat<>0 then
begin
UnHookWindowsHookEx(hkQQChat);
hkQQChat := 0;
Result := True;
end
else
Result := False;
end;
end.
====================================
调用的应用程序就很简单了,调用EnableWheelHook后隐藏就可以了,退出时DisableWheelHook就OK啦。
程序仅仅提供大家一个思路,还有很多不完善的地方,希望有兴趣的朋友联系我,共同交流提高。
 
上一页 [1] [2]
进入问吧