📄 about.pas
字号:
unit about;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls, Registry, jpeg, RXCtrls;
type
Tformabout = class(TForm)
ProgramIcon: TImage;
ProductName: TLabel;
Version: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
OS: TLabel;
PhysMem: TLabel;
BitBtn1: TBitBtn;
SecretPanel1: TSecretPanel;
lblCopyRight: TLabel;
lblCopyRightSymbol1: TLabel;
lblTrademarkSymbol2: TLabel;
Label4: TLabel;
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure GetOSInfo;
procedure InitializeCaptions;
end;
var
formabout: Tformabout;
implementation
{$R *.DFM}
procedure Tformabout.FormCreate(Sender: TObject);
var
reg:TRegistry;
username,productid:string;
begin
reg:=TRegistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKey('\Software\Pasa\',false);
username:=Reg.ReadString('UserName');
productid:=Reg.ReadString('ProductId');
Label2.Caption:=Label2.Caption+username;
Label3.Caption:=Label3.Caption+productid;
Reg.CloseKey;
Reg.Free;
secretpanel1.Active:=true;
end;
procedure Tformabout.FormShow(Sender: TObject);
begin
left:=10;
top:=5;
InitializeCaptions;
end;
procedure Tformabout.FormClose(Sender: TObject; var Action: TCloseAction);
begin
secretpanel1.active:=false;
formabout:=nil;
action:=cafree;
end;
procedure TFormabout.GetOSInfo;
var
Platform: string;
BuildNumber: Integer;
begin
case Win32Platform of
VER_PLATFORM_WIN32_WINDOWS:
begin
Platform := 'Windows 98';
BuildNumber := Win32BuildNumber and $0000FFFF;
end;
VER_PLATFORM_WIN32_NT:
begin
Platform := 'Windows NT';
BuildNumber := Win32BuildNumber;
end;
else
begin
Platform := 'Windows';
BuildNumber := 0;
end;
end;
if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) or
(Win32Platform = VER_PLATFORM_WIN32_NT) then
begin
if Win32CSDVersion = '' then
OS.Caption := Format('%s %d.%d (Build %d)', [Platform, Win32MajorVersion,
Win32MinorVersion, BuildNumber])
else
OS.Caption := Format('%s %d.%d (Build %d: %s)', [Platform, Win32MajorVersion,
Win32MinorVersion, BuildNumber, Win32CSDVersion]);
end
else
OS.Caption := Format('%s %d.%d', [Platform, Win32MajorVersion,
Win32MinorVersion])
end;
procedure TFormAbout.InitializeCaptions;
var
MS: TMemoryStatus;
begin
GetOSInfo;
MS.dwLength := SizeOf(TMemoryStatus);
GlobalMemoryStatus(MS);
PhysMem.Caption := '系统内存: '+FormatFloat('#,###" KB"', MS.dwTotalPhys div 1024);
end;
procedure Tformabout.BitBtn1Click(Sender: TObject);
begin
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -