about.pas

来自「Delphi 网络通信协议代码,是多种网络协议的实现代码」· PAS 代码 · 共 58 行

PAS
58
字号
unit About;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TfrmAbout = class(TForm)
    Image1: TImage;
    Bevel1: TBevel;
    Label5: TLabel;
    Label6: TLabel;
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    procedure Init;
  end;

procedure ShowAbout;

var
  frmAbout: TfrmAbout;

implementation

{$R *.DFM}

uses ShellAPI;

procedure ShowAbout;
begin
  Application.CreateForm(TfrmAbout, frmAbout);
  frmAbout.Init;
  frmAbout.ShowModal;
end;

procedure TfrmAbout.Init;
var MS: TMemoryStatus;
begin
  Image1.Picture.Assign(Application.Icon);
  GlobalMemoryStatus(MS);
  Label5.Caption:=Format('Windows 的可用物理内存:   %s', [FormatFloat('#,###" KB"', MS.dwTotalPhys / 1024)]);
  Label6.Caption:=Format('系统资源使用率:           %d%%',[MS.dwMemoryLoad]);
end;

procedure TfrmAbout.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action:=caFree;
end;

end.

⌨️ 快捷键说明

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