在QQ2007BETA1时,用发送的方法好使,但在这之后的BETA2就不行了,也不知道是什么原因?是窗口的句柄不对吗?下面是代码请帮助一下<br>procedure SetWndText(hWnd: HWND; Text: String);<br><br>Var<br><br> Ret:LongInt;<br><br> mText
Char;<br><br> Buf:Integer;<br><br>begin<br><br> GetMem(mText,Length(Text));<br><br> StrCopy(mText,PChar(Text));<br><br> try<br><br> Buf:=LongInt(mText);<br><br> SendMessage(hWnd,WM_SETTEXT,0,Buf);<br><br> finally<br><br> FreeMem(mText,Length(Text));<br><br> end;<br> end;<br> procedure qqd(n:string;p:string;w:hwnd);<br>var<br>Number2, PassWord2, btnWnd, Window, Number,s, PassWord: hwnd;<br>begin<br>try<br>window:=0;<br>number:=0;<br>number2:=0;<br>password:=0;<br>password2:=0;<br><br> window:=w;<br> s:=window;<br> Number := FindWindowEx(Window, 0, 'ComboBox', nil);<br> Number2 := FindWindowEx(number, 0, 'Edit', nil);<br> if Number=0 then Exit;<br> PassWord := FindWindowEx(Window, 0, '#32770', nil);<br> PassWord2 := FindWindowEx(PassWord, 0, 'Edit', nil);<br> if PassWord=0 then Exit;<br><br> if Number2<>0 then SetWndText(number2, trim
);<br> if PassWord2<>0 then SetWndText(PassWord2, trim(p));<br> if s<>0 then<br> begin<br> btnWnd:=GetDlgItem(s,16032);<br> SendMessage(btnWnd,WM_LBUTTONDOWN,MK_LBUTTON,0);<br> SendMessage(btnWnd,WM_LBUTTONUP,0,0);<br> end;<br> except<br><br> on Exception do <br><br>MessageDlg('程序错误', mtError, [mbOk], 0);<br> <br>end;