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);
//这是主窗口的消息处理函数 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;