QQ2000B刷屏机的源码,(Delphi,VC)双版本的(2)

2008-04-09 04:30:40来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折


// 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¦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);

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:李维问答集之语言真的不重要吗?

下一篇:获得BIOS信息