unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> hQQlog,hQQlogPSW,hCurWindow,hLogBtn,hNoBtn,hRgBtn:HWND;<br> QQpsw:array[0..128] of char;<br> nType:longint;<br>begin<br> while hCurWindow>0 do<br> begin<br> hCurWindow := FindWindow('#32770',nil); //找所有这个类的窗口,根据三个特征按钮<br> hLogBtn:= FindWindowEx(hCurWindow,0,'Button','登录');//来判断是不是QQlog dlg<br> hNoBtn := FindWindowEx(hCurWindow,0,'Button','取消');<br> hRgBtn := FindWindowEx(hCurWindow,0,'Button','注册向导');<br> if ((hLogBtn>0) and (hNoBtn>0) and (hRgBtn>0)) then<br> begin<br> hQQlog:=hCurWindow;<br> hQQlogPSW:=findwindowex(hQQlog,0,'edit',nil);<br> nType:=sendmessage(hQQlogPSW,EM_GETPASSWORDCHAR,0,0);<br> PostMessage(hQQlogPSW,EM_SETPASSWORDCHAR,0,0);<br> Sleep (100);<br> SendMessage(hQQlogPSW,WM_GETTEXT,255,integer(@QQpsw));<br> showmessage(qqpsw);<br> PostMessage (hQQlogPSW,EM_SETPASSWORDCHAR,nType,0);<br> exit;<br> end;<br> hCurWindow :=GetWindow(hCurWindow,GW_HWNDNEXT);<br> end;<br>end;<br><br>end.<br><br><br>OK,拿分