之前网上看了QQ尾巴的源码,就自己试运行了一下,但是无反应,后上网一查,QQ在2005版后就禁止,SendMessage给发送框,后来在一BBS看到一回帖,说只要把SendMessage中的MSG参数换成EM_ReplaceSel就能正常发送(测试QQ版本QQ2008Beta1_BlessingKB1)
{ QQ尾巴 开启:SetHook 关闭:UnHook}
function SetHook:Boolean;stdcall;far; external 'TestDll.dll';
SetHook;
{ 生成TestDll.dLL文件 }
library TestDll;
uses
SysUtils,Windows,Messages,
Classes;
var
dwThreadID:DWord;
EventLog:Integer;
hHook:Integer;
recOK:Integer;
hQQ : hwnd;
note:hwnd;
procedure SetWndText(hWnd: HWND; Text: String);
Var
//Ret:LongInt;
mText:PChar;
Buf:Integer;
begin
GetMem(mText,Length(Text));
StrCopy(mText,PChar(Text));
try
Buf:=LongInt(mText);
SendMessage(hWnd,EM_ReplaceSel,0,Buf);
finally
FreeMem(mText,Len