De repente acontece e você está lá: de frente para o computador. E na tela do computador apenas a misteriosa
"*****". Então você se pergunta: que senha será esta que está digitada? Bom, antes de você optar pelo método
de tentativa e erro, crie uma aplicação nova no Delphi e coloque no formulário um componente TTimer. No
evento OnTimer deste componente coloque o seguinte código:
agora como descobrir senha oculta
Está pronto! Agora basta você executar a aplicação e mante-la minimizada. Quando parar o ponteiro do mouse sobre o Edit que contém o misterioso "********" você verá um Hint informando qual é a senha que foi digitada.
"*****". Então você se pergunta: que senha será esta que está digitada? Bom, antes de você optar pelo método
de tentativa e erro, crie uma aplicação nova no Delphi e coloque no formulário um componente TTimer. No
evento OnTimer deste componente coloque o seguinte código:
var
WndHint: THintWindow = nil; // declare a variável fora da procedure
procedure TForm1.Timer1Timer(Sender: TObject);
var
Pos: TPoint;
HWin: THandle;
Paswd: array[0..63] of Char;
R: TRect;
begin
GetCursorPos(Pos);
HWin := WindowFromPoint(Pos);
if SendMessage(HWin, EM_GETPASSWORDCHAR, 0, 0) <> 0 then
begin
if WndHint = nil then
begin
WndHint := THintWindow.Create(Self);
WndHint.Color := clInfoBk;
SendMessage(HWin, WM_GETTEXT, 64, Longint(@Paswd));
R := Rect(Pos.X, Pos.Y + 18, Pos.X +
WndHint.Canvas.TextWidth(Paswd) + 8,
Pos.Y + 18 + WndHint.Canvas.TextHeight(Paswd));
WndHint.ActivateHint(R, Paswd);
end;
end
else if WndHint <> nil then
begin
WndHint.ReleaseHandle;
WndHint := nil;
end;
end;
WndHint: THintWindow = nil; // declare a variável fora da procedure
procedure TForm1.Timer1Timer(Sender: TObject);
var
Pos: TPoint;
HWin: THandle;
Paswd: array[0..63] of Char;
R: TRect;
begin
GetCursorPos(Pos);
HWin := WindowFromPoint(Pos);
if SendMessage(HWin, EM_GETPASSWORDCHAR, 0, 0) <> 0 then
begin
if WndHint = nil then
begin
WndHint := THintWindow.Create(Self);
WndHint.Color := clInfoBk;
SendMessage(HWin, WM_GETTEXT, 64, Longint(@Paswd));
R := Rect(Pos.X, Pos.Y + 18, Pos.X +
WndHint.Canvas.TextWidth(Paswd) + 8,
Pos.Y + 18 + WndHint.Canvas.TextHeight(Paswd));
WndHint.ActivateHint(R, Paswd);
end;
end
else if WndHint <> nil then
begin
WndHint.ReleaseHandle;
WndHint := nil;
end;
end;
agora como descobrir senha oculta
Var
WndHint: THintWindow = nil; // declare a variável fora da procedure
procedure TForm1.Timer1Timer(Sender: TObject);
var
Pos: TPoint;
HWin: THandle;
Paswd: array[0..63] of Char;
R: TRect;
begin
GetCursorPos(Pos);
HWin := WindowFromPoint(Pos);
if SendMessage(HWin, EM_GETPASSWORDCHAR, 0, 0) <> 0 then
begin
if WndHint = nil then
begin
WndHint := THintWindow.Create(Self);
WndHint.Color := clInfoBk;
SendMessage(HWin, WM_GETTEXT, 64, Longint(@Paswd));
R := Rect(Pos.X, Pos.Y + 18, Pos.X +
WndHint.Canvas.TextWidth(Paswd) + 8,
Pos.Y + 18 + WndHint.Canvas.TextHeight(Paswd));
WndHint.ActivateHint(R, Paswd);
end;
end
else if WndHint <> nil then
begin
WndHint.ReleaseHandle;
WndHint := nil;
end;
end;
WndHint: THintWindow = nil; // declare a variável fora da procedure
procedure TForm1.Timer1Timer(Sender: TObject);
var
Pos: TPoint;
HWin: THandle;
Paswd: array[0..63] of Char;
R: TRect;
begin
GetCursorPos(Pos);
HWin := WindowFromPoint(Pos);
if SendMessage(HWin, EM_GETPASSWORDCHAR, 0, 0) <> 0 then
begin
if WndHint = nil then
begin
WndHint := THintWindow.Create(Self);
WndHint.Color := clInfoBk;
SendMessage(HWin, WM_GETTEXT, 64, Longint(@Paswd));
R := Rect(Pos.X, Pos.Y + 18, Pos.X +
WndHint.Canvas.TextWidth(Paswd) + 8,
Pos.Y + 18 + WndHint.Canvas.TextHeight(Paswd));
WndHint.ActivateHint(R, Paswd);
end;
end
else if WndHint <> nil then
begin
WndHint.ReleaseHandle;
WndHint := nil;
end;
end;
Comment