//试试这个吧,我从别人那里看来了<br>procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br> Pos : TPoint;<br> Handle : HWND;<br> Buf : array[0..1024] of Char;<br> passmark : Integer;<br>begin<br> GetCursorPos(Pos);<br> Handle := WindowFromPoint(Pos);<br> GetClassName(Handle, Buf, 1024);<br> passmark := SendMessage(Handle, EM_GETPASSWORDCHAR, 0, 0);<br> if passmark <> 0 then<br> begin<br> postmessage(Handle, EM_SETPASSWORDCHAR, 0, 0);<br> SendMessage(Handle, WM_GETTEXT, 1024, Integer(@Buf));<br> postmessage(Handle, EM_SETPASSWORDCHAR, wparam(ord('*')), 0);<br> end<br> else<br> SendMessage(Handle, WM_GETTEXT, 1024, Integer(@buf));<br> Edit1.Text := Buf;<br><br>end;<br>