http://www.delphibbs.com/delphibbs/dispq.asp?lid=794058<br><br><br>procedure TMainForm.TimerTimer(Sender: TObject);<br>var<br> Pos: TPoint;<br> Handle: HWND;<br> Buf: array[0..1024] of Char;<br>begin<br> GetCursorPos(Pos);<br> Handle := WindowFromPoint(Pos);<br> HandleEdit.Text := IntToStr(Handle);<br> GetClassName(Handle, Buf, 1024);<br> ClassEdit.Text := Buf;<br> SendMessage(Handle, WM_GETTEXT, 1024, Integer(@Buf));<br> TextEdit.Text := Buf;<br>end;<br><br><br>来自:xiao_min, 时间:2001-12-20 13:15:00, ID:800252 <br>其实方法我上面已经说过了,你试一下:<br>passmark:=sendmessage(curwin,em_getpasswordchar,0,0);<br>if passmark<>0 then<br> begin<br>postmessage(curwin,em_setpasswordchar,0,0);<br>count:=sendmessage(curwin,wm_gettext,100,lparam(@text1));<br>postmessage(curwin,em_setpasswordchar,wparam(ord('*')),0);<br>end;<br><br><br><br><br>测试结果:<br>xp下可以,其实直接向目标控件发送<br>SendMessage(hwnd, EM_SETPASSWORDCHAR, longint(0), 0)<br>就可以显示出来。<br>但是2000下绝对不行!也许是我们的服务器安装了pack的缘故吧。<br><br>