向QQ2007正式版的密码框中发送密码或者通过模拟键盘输入密码 ( 积分: 100 )

  • 主题发起人 主题发起人 songzhi
  • 开始时间 开始时间
S

songzhi

Unregistered / Unconfirmed
GUEST, unregistred user!
向QQ上2007正式版的密码框中发送密码或者通过模拟键盘输入密码
 
我这有个别人编好的.不知道是怎么做的.以前也有人这么问过.这方面以前没有接触过.不太了解.
 
获得密码框的句柄,<br>然后sendmessage(HWND,WM_CHAR,100,0)<br>就OK了~
 
在QQ2007BETA1时,用发送的方法好使,但在这之后的BETA2就不行了,也不知道是什么原因?是窗口的句柄不对吗?下面是代码请帮助一下<br>procedure&nbsp;SetWndText(hWnd:&nbsp;HWND;&nbsp;Text:&nbsp;String);<br><br>Var<br><br>&nbsp;&nbsp;Ret:LongInt;<br><br>&nbsp;&nbsp;mText:PChar;<br><br>&nbsp;&nbsp;Buf:Integer;<br><br>begin<br><br>&nbsp;&nbsp;GetMem(mText,Length(Text));<br><br>&nbsp;&nbsp;StrCopy(mText,PChar(Text));<br><br>&nbsp;&nbsp;try<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Buf:=LongInt(mText);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;SendMessage(hWnd,WM_SETTEXT,0,Buf);<br><br>&nbsp;&nbsp;finally<br><br>&nbsp;&nbsp;&nbsp;&nbsp;FreeMem(mText,Length(Text));<br><br>&nbsp;&nbsp;end;<br>&nbsp;end;<br>&nbsp;procedure&nbsp;qqd(n:string;p:string;w:hwnd);<br>var<br>Number2,&nbsp;PassWord2,&nbsp;btnWnd,&nbsp;Window,&nbsp;Number,s,&nbsp;PassWord:&nbsp;hwnd;<br>begin<br>try<br>window:=0;<br>number:=0;<br>number2:=0;<br>password:=0;<br>password2:=0;<br><br>&nbsp;&nbsp;&nbsp;window:=w;<br>&nbsp;&nbsp;&nbsp;s:=window;<br>&nbsp;&nbsp;Number&nbsp;:=&nbsp;FindWindowEx(Window,&nbsp;0,&nbsp;'ComboBox',&nbsp;nil);<br>&nbsp;&nbsp;Number2&nbsp;:=&nbsp;FindWindowEx(number,&nbsp;0,&nbsp;'Edit',&nbsp;nil);<br>&nbsp;&nbsp;if&nbsp;Number=0&nbsp;then&nbsp;Exit;<br>&nbsp;&nbsp;PassWord&nbsp;:=&nbsp;FindWindowEx(Window,&nbsp;0,&nbsp;'#32770',&nbsp;nil);<br>&nbsp;&nbsp;PassWord2&nbsp;:=&nbsp;FindWindowEx(PassWord,&nbsp;0,&nbsp;'Edit',&nbsp;nil);<br>&nbsp;&nbsp;if&nbsp;PassWord=0&nbsp;then&nbsp;Exit;<br><br>&nbsp;&nbsp;&nbsp;if&nbsp;Number2&lt;&gt;0&nbsp;then&nbsp;&nbsp;SetWndText(number2,&nbsp;trim(n));<br>&nbsp;&nbsp;&nbsp;if&nbsp;PassWord2&lt;&gt;0&nbsp;then&nbsp;SetWndText(PassWord2,&nbsp;trim(p));<br>&nbsp;&nbsp;&nbsp;if&nbsp;s&lt;&gt;0&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;begin<br>&nbsp;btnWnd:=GetDlgItem(s,16032);<br>&nbsp;SendMessage(btnWnd,WM_LBUTTONDOWN,MK_LBUTTON,0);<br>&nbsp;SendMessage(btnWnd,WM_LBUTTONUP,0,0);<br>&nbsp;end;<br>&nbsp;except<br><br>&nbsp;on&nbsp;Exception&nbsp;do&nbsp;&nbsp;&nbsp;<br><br>MessageDlg('程序错误',&nbsp;mtError,&nbsp;[mbOk],&nbsp;0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>end;
 
在QQ2007BETA1时,用发送的方法好使,但在这之后的BETA2就不行了,也不知道是什么原因?是窗口的句柄不对吗?下面是代码请帮助一下<br>procedure&nbsp;SetWndText(hWnd:&nbsp;HWND;&nbsp;Text:&nbsp;String);<br><br>Var<br><br>&nbsp;&nbsp;Ret:LongInt;<br><br>&nbsp;&nbsp;mText:PChar;<br><br>&nbsp;&nbsp;Buf:Integer;<br><br>begin<br><br>&nbsp;&nbsp;GetMem(mText,Length(Text));<br><br>&nbsp;&nbsp;StrCopy(mText,PChar(Text));<br><br>&nbsp;&nbsp;try<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Buf:=LongInt(mText);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;SendMessage(hWnd,WM_SETTEXT,0,Buf);<br><br>&nbsp;&nbsp;finally<br><br>&nbsp;&nbsp;&nbsp;&nbsp;FreeMem(mText,Length(Text));<br><br>&nbsp;&nbsp;end;<br>&nbsp;end;<br>&nbsp;procedure&nbsp;qqd(n:string;p:string;w:hwnd);<br>var<br>Number2,&nbsp;PassWord2,&nbsp;btnWnd,&nbsp;Window,&nbsp;Number,s,&nbsp;PassWord:&nbsp;hwnd;<br>begin<br>try<br>window:=0;<br>number:=0;<br>number2:=0;<br>password:=0;<br>password2:=0;<br><br>&nbsp;&nbsp;&nbsp;window:=w;<br>&nbsp;&nbsp;&nbsp;s:=window;<br>&nbsp;&nbsp;Number&nbsp;:=&nbsp;FindWindowEx(Window,&nbsp;0,&nbsp;'ComboBox',&nbsp;nil);<br>&nbsp;&nbsp;Number2&nbsp;:=&nbsp;FindWindowEx(number,&nbsp;0,&nbsp;'Edit',&nbsp;nil);<br>&nbsp;&nbsp;if&nbsp;Number=0&nbsp;then&nbsp;Exit;<br>&nbsp;&nbsp;PassWord&nbsp;:=&nbsp;FindWindowEx(Window,&nbsp;0,&nbsp;'#32770',&nbsp;nil);<br>&nbsp;&nbsp;PassWord2&nbsp;:=&nbsp;FindWindowEx(PassWord,&nbsp;0,&nbsp;'Edit',&nbsp;nil);<br>&nbsp;&nbsp;if&nbsp;PassWord=0&nbsp;then&nbsp;Exit;<br><br>&nbsp;&nbsp;&nbsp;if&nbsp;Number2&lt;&gt;0&nbsp;then&nbsp;&nbsp;SetWndText(number2,&nbsp;trim(n));<br>&nbsp;&nbsp;&nbsp;if&nbsp;PassWord2&lt;&gt;0&nbsp;then&nbsp;SetWndText(PassWord2,&nbsp;trim(p));<br>&nbsp;&nbsp;&nbsp;if&nbsp;s&lt;&gt;0&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;begin<br>&nbsp;btnWnd:=GetDlgItem(s,16032);<br>&nbsp;SendMessage(btnWnd,WM_LBUTTONDOWN,MK_LBUTTON,0);<br>&nbsp;SendMessage(btnWnd,WM_LBUTTONUP,0,0);<br>&nbsp;end;<br>&nbsp;except<br><br>&nbsp;on&nbsp;Exception&nbsp;do&nbsp;&nbsp;&nbsp;<br><br>MessageDlg('程序错误',&nbsp;mtError,&nbsp;[mbOk],&nbsp;0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>end;
 
应该是QQ挂钩了吧。<br><br>你可以做个测试,打开qq框后,用SPY查下密码框的handle,<br>然后在程序中直接用这个handle,sendmessage。如果不成的话<br>说明QQ挂钩了。
 
呵呵.刚写完类似的功能就有人在问啊?<br><br>QQ挂钩.我用键盘模拟实现.
 
键盘模拟的方法我也用了,但也不知道什么地方有错误,QQ挂钩能给代码吗?
 
这个应该早就不能了,QQ的键盘锁会保护一切的消息的,也防止挂钩截取...[:(]
 

Similar threads

D
回复
0
查看
824
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
后退
顶部