unit ViewPassword_Unit;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls, Buttons;type
  TForm1 = class(TForm)
    Label1: TLabel;
    Timer1: TTimer;
    BitBtn1: TBitBtn;
    procedure Timer1Timer(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;
  ct:boolean;implementation{$R *.DFM}procedure TForm1.Timer1Timer(Sender: TObject);
var
 p:tpoint;
 h:hwnd;
begin
  getcursorpos(p);
  label1.Caption:='X= '+inttostr(p.x)+'   Y= '+inttostr(p.y);
  h:=windowfrompoint(p);
  if iswindow(h) then
  begin
  sendmessage(h,em_setpasswordchar,0,0);
  invalidaterect(h,nil,false);
  end;
end;procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  if ct then
    begin
      timer1.Enabled:=true;
      bitbtn1.Caption:='&Stop';
    end else
    begin
      timer1.Enabled:=false;
      bitbtn1.Caption:='&Start';
    end;
  ct:=not ct;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
  timer1.Enabled:=false;
  label1.Caption:='';
  ct:=true;
end;{
function TfrmMain.GetPassword(Sender:TObject):string;
var
hWnd:THandle;
lpCurPos:TPoint;
lntLen:Longint;
pchPass:pchar;
begin
GetCursorPos(lpCurPos);//»ñÈ¡µ±Ç°Êó±êλÖÃ
hWnd:=WindowFromPoint(Sender);//»ñÈ¡µ±Ç°Êó±êλÖõĴ°¿Ú¾ä±ú
lntLen:=SendMessage(hWnd,WM_GETTEXTLENGTH,0,0);
//if GetWindowLong(hWnd,GWL_STYLE) and ES_PASSWORD <> 0 then //&Aring;&ETH;&para;&Iuml;&Ecirc;&Ccedil;·&ntilde;&Icirc;&ordf;&Atilde;&Uuml;&Acirc;&euml;&iquest;ò
begin
  GetMem(pchPass,lntLen+1);
  if lntLen > 0 then
  SendMessage(hWnd,WM_GETTEXT,lntLen+1,Integer(pchPass));//&raquo;&ntilde;&Egrave;&iexcl;&Atilde;&Uuml;&Acirc;&euml;&acute;&reg;
  Result:=String(pchPass);
  FreeMem(pchPass,lntLen+1);
end;
end;
}end.