您的位置:首页 > 其它

QQ自动发消息器 1.0

2007-04-18 11:04 218 查看
在2007新版本的qq已经不适用,因为腾讯屏蔽了RICHEDIT类的API调用

源码如下(VC6编译通过):

#include<windows.h>
#include<iostream.h>

int CALLBACK my(HWND ,LPARAM );

HWND n3=NULL,n4=NULL;

void main()
{
static char s[100];
int t,n=0;
cout<<"********************************************************/n/n";
cout<<" QQ自动发消息器 1.0 /n/n";
cout<<" 河马制作 /n/n";
cout<<"********************************************************/n/n";
cout<<"请打开QQ,打开你想发的好友的消息框,并切换到-聊天模式-/n/n";
cout<<"请输入你想要说的话/n/n";
cin>>s;
cout<<"/n请输入你想发多少句,回车开始,请不要关闭本窗口和QQ窗口/n/n";
cin>>t;

EnumWindows( WNDENUMPROC(my),0);

cout<<"正在发……/n";
cout.flush();
while(n<t)
{

SendMessage(n3,EM_REPLACESEL,1,(LPARAM)s);
SendMessage(n4,BM_CLICK,0,0);
n++;
Sleep(1000);
}

cout<<"/n";
cout<<"已经发完了……/n";
cout.flush();

}

int CALLBACK my(HWND n,LPARAM )
{

HWND n1,n2;
int t=1;
if(GetWindowLong(n,GWL_STYLE)==0x160F0044 )
{
t=0;
n1=FindWindowEx(n,0,"#32770",0);
n2=FindWindowEx(n1,0,"AfxWnd42",0);
n3=FindWindowEx(n2,0,"RICHEDIT",0);
n4=FindWindowEx(n1,0,"Button","发送(&S)");
if(!n4)
{
n4=FindWindowEx(n1,0,"Button","发送(S)");

}
}

return t;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: