QQ2000B刷屏机的源码(Delphi)
QQ2000BË?ÆÁ?úµÄÔ?Âë(Delphi)
-------------------Delphi?æµÄ:-------------- program chat2001;
uses
??windows,messages,sysutils;
{$R *.RES}
const
??CRLF=#13#10;
??exename:pchar='Ë?ÆÁ?úÆ?ÈË 2001'; var
//----------------------
??wClass:??TWndClass;??//???ÚÀà?äÁ? ??Msg:??????TMSG;?????? //ÏûÏ??äÁ? ??hInst,???????????? ??//?ÌÐòʵÀý ??Handle,???????????? ??//Ö????Ú?ä?ú ??hFont,???????????? ??//×ÖÌå?ä?ú //----------------
??hButtonStart,??//?ªÊ???Å?
??hButtonStop,????//Í?Ö???Å?
??hButtonHelp,????//?ïÖú??Å?
??hButtonExit,????//ÍË?ö??Å?
??hEditEmail,????//e-mail?à?-
??hLabelEmail,????//e-mailÌáÊ?
??mcount,tempwnd,qqmainw,richedit:integer; ??lp:longint;
??newtime:integer;
//--------------------
//ÍùÒ??ö???ÚÐ??êÌâ
procedure WriteCaption(hwnd:hwnd;text:pchar);begin sendmessage(hwnd,WM_SETTEXT,0,integer(text));end; //?ÓÒ??ö???Ú?Á?êÌâ
procedure ReadCaption(hwnd:hwnd;text:pchar);begin sendmessage(hwnd,WM_GETTEXT,400,integer(text));end;
procedure ButtonHelp;
var s1:string;
begin
??s1:='??Èí?þÖ?ÓÃÑ?Ï?ÓÃ?????ɺ?ÈË'+CRLF+ ???? '?ÌÐòÏòQQ2000BµÄÊäÈë?òÖÐÊäÈëÎÄ×Ö????ËÍ!'+CRLF+
??????'ÏêÏ?×ÊÁÏ????Ô?ÂëÔÚ×?ÕßÖ?Ò?ÉÏ'+CRLF+ ??????'Ö?Ò?:hotsky.363.net'+CRLF;
??messagebox(handle,pchar(s1),'?ïÖú',0); end;
//Ö??ÌÐò?áÊø
procedure ShutDown;
begin
??//É??ý×ÖÌå?ÔÏó
??DeleteObject(hFont);
??//È?Ïû???ÚÀàµÄ×??á
??UnRegisterClass(wClass.lpszClassName,hInst); ??//?áÊøÖ??ø?Ì
??ExitProcess(hInst);
end;
procedure ontimer;
var
len:integer;
str:array[0..500] of char;
begin
??inc(mcount);
??//strcopy(str,pchar(format('ÎÒÊÇ %d
ºÅË?ÆÁ?úÆ?ÈË......',[mcount])));
??readCaption(heditemail,str);
??strcopy(str,pchar(format('ÎÒÊÇ %d
ºÅË?ÆÁ?úÆ?ÈË......',[mcount])));
??if (mcount mod 2)<>0 then
??begin
????len:=strlen(str);
????str[len]:=' ';???????? ??????
????str[len+1]:=#0;
??end;
??qqmainw:=FindWindow('AfxFrameOrView42s',nil); ??qqmainw:=FindWindowEx(qqmainw,0,'AfxMDIFrame42s',nil);
qqmainw:=FindWindowEx(qqmainw,0,'AfxFrameOrView42s',nil);
??qqmainw:=GetNextWindow(qqmainw,GW_HWNDNEXT); ??qqmainw:=FindWindowEx(qqmainw,0,'#32770',nil); ??richedit:=FindWindowEx(qqmainw,0,'RICHEDIT',nil); //??SetFocus(richedit);
??SendMessage(richedit,EM_SETSEL,0,-1); ??SendMessage(richedit,EM_REPLACESEL,1,integer(@str)); ??PostMessage(richedit,WM_KEYDOWN ,VK_RETURN,$001c0001); ??PostMessage(richedit,WM_KEYUP,VK_RETURN,$c01c0001); ??strcopy(str,pchar(format('ÎÒÊÇ %d
ºÅË?ÆÁ?úÆ?ÈË......',[mcount])));
??writeCaption(hlabelemail,str);
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,2950,nil); end; ????if lParam=hButtonStop then begin
mcount:=0;killtimer(handle,newtime); end;
????if lParam=hButtonHelp then ButtonHelp;
????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 CreateEdit(name:pchar;x1,y1,x2,y2:integer):hwnd;begin Result:=CreateWindowEx(WS_EX_CLIENTEDGE,'Edit',name,WS_VISIBLE or WS_CHILD or ES_LEFT or
ES_AUTOHSCROLL,x1,y1,x2,y2,Handle,0,hInst,nil);end; function CreateLabel(name:pchar;x1,y1,x2,y2:integer):hwnd;begin Result:=CreateWindow('Static',name,WS_VISIBLE or WS_CHILD or SS_LEFT,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;
function EnumChildProc(hwnd:integer;uint:integer):bool; var classname,c2:array[0..100] of char;
hp:integer;
begin
??if hwnd<>0 then
??begin
??hp:=hwnd;
??//hp:=getparent(hwnd);
//??hp:=getparent(hp);
//??hp:=getparent(hp);
//??hp:=getparent(hp);
??writeCaption(hlabelemail,pchar(format('%x',[hp]))); ??end;
??//??GetClassName(hwnd,classname,100);
//??GetClassName(hp,c2,100);
//??if (strcomp(classname,pchar('RICHEDIT'))=0) and (strcomp(c2,pchar('AfxFrameOrView42s'))=0) then richedit:=hwnd; ??result:=true;
end;
//---------Ö??ý?Ì??ÀàËÆÓÚ CÓïÑÔ ÖÐµÄ WinMain() begin
??//??Á?Ö????Ú
??handle:=CreateMain(exename,0,0,384,140);
??//??Á?ËÄ?ö?ØÖÆ??Å?
??hButtonStart:=CreateButton('?ªÊ?Ë?ÆÁ',300,4+26*0,70,24); ??hButtonStop:=CreateButton('Í?Ö?Ë?ÆÁ' ,300,4+26*1,70,24); ??hButtonHelp:=CreateButton('?ï??Öú' ,300,4+26*2,70,24); ??hButtonExit:=CreateButton('ÍË???ö' ,300,4+26*3,70,24); ??//??Á?Á??ö?à?-?ò
??hEditEmail:=CreateEdit('ÎÒÊÇË?ÆÁ?úÆ?ÈË1.0',4,26,286,80); ??//??Á?Èý?ö?êÇ?
??hLabelEmail:=CreateLabel('Ë?ÆÁÐÅÏ?:',4,8,286,16); ??//????×ÖÌå?ÔÏó
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(hButtonHelp,WM_SETFONT,hFont,0); ??SendMessage(hButtonExit,WM_SETFONT,hFont,0); ??SendMessage(hEditEmail,WM_SETFONT,hFont,0); ??SendMessage(hLabelEmail,WM_SETFONT,hFont,0); ??//
//??qqmainw:=FindWindow('AfxFrameOrView42s',nil); //??if qqmainw<>0 then messagebox(0,'','',0); ??// tempwnd:=FindWindowEx(qqmainw,0,'AfxMDIFrame42s',nil); ??lp:=0;
//??EnumChildWindows(GetDesktopWindow,@EnumChildProc,lp); //??EnumChildWindows(qqmainw,@EnumChildProc,lp); ??//?øÈëÏûÏ?Ñ-??
??while(GetMessage(Msg,Handle,0,0))do
??begin
????TranslateMessage(Msg);
????DispatchMessage(Msg);
??end;
end.
------------------------VC?æµÄ------------------------ #include
int mcount=0,newtime;
HWND hMain,hEdit,hButton1,hButton2,hButton3; LPCTSTR hTitle="QQ2000B ÁÄÌìÊÒË?ÆÁ?ú v1.0"; char hHelp[1024];
void OnTimer(void)
{
??int len;
??char str[1024];
??HWND richedit;
??mcount++;
??GetWindowText(hEdit,str,1024);
??if((mcount%2)!=0){len=strlen(str);str[len]=' ';str[len+1]='\0';}
??richedit=FindWindow("AfxFrameOrView42s",NULL); ??richedit=FindWindowEx(richedit,0,"AfxMDIFrame42s",NULL);
richedit=FindWindowEx(richedit,0,"AfxFrameOrView42s",NULL); ??richedit=GetNextWindow(richedit,GW_HWNDNEXT); ??richedit=FindWindowEx(richedit,0,"#32770",NULL); ??richedit=FindWindowEx(richedit,0,"RICHEDIT",NULL); ??SendMessage(richedit,EM_SETSEL,0,-1);
??SendMessage(richedit,EM_REPLACESEL,1,(LPARAM)str); ??PostMessage(richedit,WM_KEYDOWN ,VK_RETURN,0x001c0001); ??PostMessage(richedit,WM_KEYUP,VK_RETURN,0xc01c0001); ??wsprintf(str,"ÎÒÊÇ %d ºÅË?ÆÁ?úÆ?ÈË......",mcount); ??SetWindowText(hMain,str);
}
LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
????switch (msg)
????{
????????case WM_COMMAND:
??????????
if(lParam==(LPARAM)hButton1){mcount=0;newtime=SetTimer(hwnd,100,2950,NULL);}
??????????
if(lParam==(LPARAM)hButton2){mcount=0;KillTimer(hwnd,newtime);SetWindowText(hwnd,hTitle);}
?????????? if(lParam==(LPARAM)hButton3)
????????????{
????????????????wsprintf(hHelp,"ÔÚ?à?-?òÖÐÊäÈëÒªË?ÆÁµÄÄÚÈÝ??È?ºó\nµã???ªÊ?Ë?ÆÁ??Èç?ûµã??Í?Ö?Ë?ÆÁ\nÔòϵÍ?????ÔÙË?ÆÁ\n???ÌÐòÓÃlccwin32?àÒë\n?ÌÐòÉè?Æ:njhhack(??Ó?)\noicq:10772919\ne-mail:njh21cn.com\nÖ?Ò?:hotsky.363.net");
????????????????MessageBox(hwnd,(LPCSTR)hHelp,"ϵÍ??ïÖú",0); ????????????}
????????????break;
????????case WM_TIMER:
????????????OnTimer();
????????????break;
????????case WM_DESTROY:
????????????PostQuitMessage(0);
????????????break;
????????default:
????????????return DefWindowProc(hwnd,msg,wParam,lParam); ????}
????return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)
{
????MSG msg;
????WNDCLASS wc;
????HFONT hFont;
????//
????memset(&wc,0,sizeof(WNDCLASS));
????wc.style=0;
????wc.lpfnWndProc=(WNDPROC)MainWndProc;
????wc.hInstance=hInstance;
????wc.hbrBackground=(HBRUSH)(COLOR_BTNFACE+1);
????wc.lpszClassName="chat2001WndClass";
????wc.lpszMenuName=NULL;
????wc.hCursor=LoadCursor(NULL,IDC_ARROW);
????wc.hIcon=LoadIcon(NULL,IDI_APPLICATION);
????if(!RegisterClass(&wc))return 0;
????hMain=CreateWindow(wc.lpszClassName,hTitle,WS_OVERLAPPEDWINDOW¦WS_VISIBLE,10,10,250,190,NULL,NULL,hInstance,NULL); ????if(hMain==0)return 0;
????hEdit=CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","Ë?ÆÁ?úÆ?ÈË1.0?âÊÔ?æ",WS_VISIBLE¦WS_CHILD¦ES_MULTILINE¦ES_AUTOHSCROLL,10,10,225,115,hMain,NULL,hInstance,NULL); ????hButton1=CreateWindow("BUTTON","?ªÊ?Ë?ÆÁ",WS_VISIBLE¦WS_CHILD¦BS_PUSHLIKE¦BS_TEXT,10,132,60,24,hMain,NULL,hInstance,NULL);
????hButton2=CreateWindow("BUTTON","Í?Ö?Ë?ÆÁ",WS_VISIBLE¦WS_CHILD¦BS_PUSHLIKE¦BS_TEXT,80,132,60,24,hMain,NULL,hInstance,NULL);
????hButton3=CreateWindow("BUTTON","ϵÍ??ïÖú",WS_VISIBLE¦WS_CHILD¦BS_PUSHLIKE¦BS_TEXT,150,132,60,24,hMain,NULL,hInstance,NULL);
????hFont=CreateFont(-12,0,0,0,0,0,0,0,GB2312_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH¦FF_DONTCARE,"ËÎÌå");
?? ????SendMessage(hEdit,WM_SETFONT,(WPARAM)hFont,(LPARAM)0); ????SendMessage(hButton1,WM_SETFONT,(WPARAM)hFont,(LPARAM)0); ????SendMessage(hButton2,WM_SETFONT,(WPARAM)hFont,(LPARAM)0); ????SendMessage(hButton3,WM_SETFONT,(WPARAM)hFont,(LPARAM)0); ????ShowWindow(hMain,SW_SHOW);
????while(GetMessage(&msg,NULL,0,0)){TranslateMessage(&msg);DispatchMessage(&msg);}
????return msg.wParam;
}
[À?Ô?:programfan.com(?à?Ì??ºÃÕß)][Ñ?È?:kjkimberly]