O
ouyongke
Unregistered / Unconfirmed
GUEST, unregistred user!
我想把"取密码过程"合在一起用,可是没有改好,郁闷:<br>procedure TForm1.GetWindowText(HWnd:HWnd;GetPassWord:Boolean=False);<br>//取得文本且可以取得密码<br>var<br> iPwdChar : Integer;<br> iPwdLast : Integer;<br> psText : array[0..255] of char;<br> //psClass: String;<br> i : Integer;<br>begin<br> iPwdChar:=SendMessage(HWnd,EM_GETPASSWORDCHAR,0,0);<br> if (iPwdChar<>0) and GetPassWord then<br> begin<br> iPwdLast := 0;<br> i := 0;<br> while iPwdLast=0 do<br> begin<br> PostMessage(HWnd,EM_SETPASSWORDCHAR,0,0);<br> Application.ProcessMessages;<br> Inc(i);<br> iPwdLast:=SendMessage(HWnd,EM_GETPASSWORDCHAR,0,0);<br> if i>100 then break;<br> end ;<br> SendMessage(HWnd,WM_GETTEXT,255,Longint(@psText));<br> //Result:=psText;<br> Memo1.Text:= psText;<br> SendMessage(HWnd,EM_SETPASSWORDCHAR,iPwdChar,0);<br> end else begin<br> SendMessage(HWnd,WM_GETTEXT,255,Longint(@psText));<br> //Result:=psText;<br> Memo1.Text:= psText;<br> end;<br> //sendMessage(HWnd, WM_GETCLASSNAME,255,Longin(@psClass));<br> GetClassName(hWND,PChar(psClass),256); //HWIND2 mText<br> SetLength(psClass,StrLen(PChar(psClass))); //mText mText<br> Edit1.Text:= psClass;<br>end;<br>老东西就不给多少分了