查看带"*"的密码<br>procedure TForm1.TimerTimer(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> TextEdit.Text := Buf;<br>end;