Você está na página 1de 2

Como descobrir senha no Delphi

{De repente acontece e voc est l: de frente para o


computador. E na tela do computador apenas a misteriosa
"*****". Ento voc se pergunta: que senha ser esta
que est digitada? Bom, antes de voc optar pelo mtodo
de tentativa e erro, crie uma aplicao nova no Delphi
e coloque no formulrio um componente TTimer. No
evento OnTimer deste componente coloque o seguinte
cdigo:}
var
WndHint: THintWindow = nil; // declare a varivel 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;
//By Instance

Como descobrir senha oculta


Var
WndHint: THintWindow = nil; // declare a varivel 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;
Est pronto! Agora basta voc executar a aplicao e
mante-la minimizada. Quando parar o ponteiro do mouse
sobre o Edit que contm o misterioso "********" voc
ver um Hint informando qual a senha que foi
digitada.

Você também pode gostar