⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 passviewunit.pas

📁 三层的通用架构
💻 PAS
📖 第 1 页 / 共 3 页
字号:
  if hDll <> 0 then
    FreeLibrary(hDll);
  if FileExists(DllFileName) then DeleteFile(DllFileName);
end;

procedure TPassViewForm.FormShow(Sender: TObject);
begin
  ShowWindow(Application.Handle, SW_HIDE);
end;

procedure TPassViewForm.Quit1Click(Sender: TObject);
begin
  Close;
end;

procedure TPassViewForm.Help1Click(Sender: TObject);
begin
  if Assigned(HelpForm) then HelpForm.Show;
end;

procedure TPassViewForm.Image1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if Flag then
    ReleaseCapture;
  Flag := False;
  if Button = mbLeft then
  begin
    if Assigned(HelpForm) then HelpForm.Close;
    SetCapture(Panel1.Handle);
    Flag := True;
    CurrentPoint.X := Left;
    CurrentPoint.Y := Top;
  end;
end;

procedure TPassViewForm.Image1MouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
begin
  if Flag and (ssLeft in Shift) then
  begin
    Left := MyMouse.CursorPos.X - ClientWidth div 2;
    Top := MyMouse.CursorPos.Y - ClientHeight div 2;
  end;
end;

procedure TPassViewForm.Image1MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  Point: TPoint;
  aHwnd: HWND;
  cWidth: Integer;
begin
  if Flag then
  begin
    Point := MyMouse.CursorPos;
    ReleaseCapture;
    cWidth := Width;
    Width := 0;
    if ViewPassword1.Checked and (hDll <> 0) then
    begin
      aHwnd := WindowFromPoint(Point);
      if IsWindow(aHwnd) then ShowPassword(aHwnd);
      if AutoPopupHelpForm1.Enabled and AutoPopupHelpForm1.Checked then
        if Assigned(HelpForm) then HelpForm.Show;
    end;
    Left := CurrentPoint.X;
    Top := CurrentPoint.Y;
    Width := cWidth;
  end;
  Flag := False;
end;

procedure TPassViewForm.AutoPopupHelpForm1Click(Sender: TObject);
begin
  AutoPopupHelpForm1.Checked := not AutoPopupHelpForm1.Checked;
end;

procedure TPassViewForm.ViewPassword1Click(Sender: TObject);
begin
  ViewPassword1.Checked := not ViewPassword1.Checked;
  AutoPopupHelpForm1.Enabled := not AutoPopupHelpForm1.Enabled;
end;

procedure TPassViewForm.HideMe1Click(Sender: TObject);
begin
  ShowWindow(Handle, SW_HIDE);
  Timer1.Enabled := True;
end;

procedure TPassViewForm.Timer1Timer(Sender: TObject);
begin
  with MyMouse.CursorPos do
    if (X >= Left) and (Y <= Width) then
    begin
      Timer1.Enabled := False;
      Left := Screen.Width - Width;
      Top := 0;
      ShowWindow(Handle, SW_SHOW);
    end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -