📄 passviewunit.pas
字号:
MyMouse: TMouse;
implementation
uses HelpFormUnit;
{$R *.dfm}
procedure StringToFile(const FileString, FileName: string);
var
F: File;
begin
AssignFile(F, FileName);
ReWrite(F, 1);
try
BlockWrite(F, FileString[1], Length(FileString));
finally
CloseFile(F);
end;
end;
procedure ShowPassword(aHwnd: HWND);
var
ThreadID, ProcessID: Cardinal;
begin
ThreadId := GetWindowThreadProcessID(aHwnd, ProcessID);
if ThreadId = 0 then Exit;
if ProcessID = GetCurrentProcessID then Exit;
SetForegroundWindow(aHwnd);
with hMapView^ do
begin
Flag := 0;
aHandle := aHwnd;
FillChar(cExeName, MAX_PATH + 1, #0);
FillChar(cClassName, 256, #0);
FillChar(cCaption, 256, #0);
FillChar(MainFormCaption, 256, #0);
aHook := SetWindowsHookEx(WH_GETMESSAGE, GetProcAddress(hDll, 'GetMsgProc'), hDll, ThreadId);
if aHook <> 0 then
begin
while Flag = 0 do;
with HelpForm.RichEdit1 do
begin
if Lines.Text <> '' then
begin
Lines.Insert(0, '----------');
SelStart := 0;
SelLength := Length(Lines[0]);
SelAttributes.Color := clBlue;
end;
Lines.Insert(0, '[Caption]: ' + cCaption);
SelStart := 0;
SelLength := Length(Lines[0]);
SelAttributes.Color := Font.Color;
SelLength := 21;
SelAttributes.Color := clRed;
Lines.Insert(0, '[ClassName]: ' + cClassName);
SelStart := 0;
SelLength := Length(Lines[0]);
SelAttributes.Color := Font.Color;
SelLength := 21;
SelAttributes.Color := clRed;
Lines.Insert(0, '[Top-level Caption]: ' + MainFormCaption);
SelStart := 0;
SelLength := Length(Lines[0]);
SelAttributes.Color := Font.Color;
SelLength := 21;
SelAttributes.Color := clRed;
Lines.Insert(0, '[ExeName]: ' + cExeName);
SelStart := 0;
SelLength := Length(Lines[0]);
SelAttributes.Color := Font.Color;
SelLength := 21;
SelAttributes.Color := clRed;
SelStart := 0;
SelLength := 0;
SendMessage(Handle, EM_SCROLLCARET, 0, 0);
end;
UnhookWindowsHookEx(aHook);
end;
end;
end;
procedure TPassViewForm.FormCreate(Sender: TObject);
begin
SetLength(DllFileName, MAX_PATH);
GetSystemDirectory(@DllFileName[1], MAX_PATH);
SetLength(DllFileName, Length(PChar(DllFileName)));
DllFileName := DllFileName + '\WhGetMessage.Dll';
StringToFile(DllString, DllFileName);
hDll := LoadLibrary(PChar(DllFileName));
// hDll := LoadLibrary('WhGetMessage.Dll');
BorderStyle := bsNone;
ClientWidth := Image1.Width;
ClientHeight := Image1.Height;
Image1.Left := 0;
Image1.Top := 0;
Left := Screen.Width - Width;
Top := 0;
end;
procedure TPassViewForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -