摘要载入中…    请稍等…












内容载入中…    请稍等…

如长时间看不到内容,请关闭浏览器,重新打开此页!

芯友首页 应用软件 编程开发 网络硬件 资源下载 动漫音乐 精美图库 芯友论坛 视频教程 电脑技术QQ群:65314343
 ★★photoshop学友-10万图书免费看★★
 位置:编程开发>Deiphi>Deiphi网络编程
◎→ 本类最新
从Internet时间服务器获取标准时
编程实现拨号网络连接及FTP应用
QQ尾巴病毒的发送原理分析
TWebBrowser控件与MSHTML库连接
动态取得网络邻居的工作组和计算
读取IE收藏夹内网址的信息
关于取本地计算机的IP地址及计算
建立Win2000 VPN服务器(1)
建立Win2000 VPN服务器(1)
监视Pop3信箱
◎→ 相关资源
VB窗体文章
HTML入门教程
JavaScript入门教程
VbScript入门教程
ASP.net入门教程
C语言入门教程
Deiphi实例教程
Deiphi窗体文章
Deiphi数据库编程
Deiphi网络编程
◎→ 热门资源
得到已安装的应用程序列表
定制系统菜单
SEO实践增加外链方法
播放背景音乐
捕捉来自Thread的异常
程序调用控制面板设置
常用文件目录操作
采用多线程技术来关闭applicatio
不用注册新部件就能增加新的方法
不用MediaPlayer播放Midi

QQ2000B刷屏机的源码(Delphi)


日期:2008-5-31 18:24:59    来源:
   
 -->QQ尾巴病毒的发送原理分析
 -->“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 <windows.h>
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&brvbar;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&brvbar;WS_CHILD&brvbar;ES_MULTILINE&brvbar;ES_AUTOHSCROLL,10,10,225,115,hMain,NULL,hInstance,NULL);
  hButton1=CreateWindow("BUTTON","开始刷屏",WS_VISIBLE&brvbar;WS_CHILD&brvbar;BS_PUSHLIKE&brvbar;BS_TEXT,10,132,60,24,hMain,NULL,hInstance,NULL);
  hButton2=CreateWindow("BUTTON","停止刷屏",WS_VISIBLE&brvbar;WS_CHILD&brvbar;BS_PUSHLIKE&brvbar;BS_TEXT,80,132,60,24,hMain,NULL,hInstance,NULL);
  hButton3=CreateWindow("BUTTON","系统帮助",WS_VISIBLE&brvbar;WS_CHILD&brvbar;BS_PUSHLIKE&brvbar;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&brvbar;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;

 [1]

将推腾讯QQ拼音输入法!

为Delphi程序添加自动滚动的工具栏

--->QQ经典连连看 2006 V2.031
--->皇族外挂-QQ四国军棋2人刷分外挂 V1.8.1 正式版
--->皇族QQ四国军棋外挂 V1.7.0 正式版
--->水晶情缘--QQ号吉祥算 V3.65
--->WorkWin管理专家(局域网监视禁止QQ禁止下载软件) V1.0
Tags:  QQ 刷屏 Delphi
{$enumber$}


芯友网版权所有 1999-2006 | 著作权与商标声明 | 法律声明 | 服务条款 | 隐私声明 | 联系我们