📄 rm_about.pas
字号:
{*****************************************}
{ }
{ Report Machine v1.0 }
{ About window }
{ }
{*****************************************}
unit RM_about;
interface
{$I RM.inc}
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TRMFormAbout = class(TForm)
btnOK: TButton;
Label1: TLabel;
lblVersion: TLabel;
Image1: TImage;
Label3: TLabel;
Bevel1: TBevel;
Bevel2: TBevel;
lblMemorrySize: TLabel;
PhysMem: TLabel;
OS: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label10: TLabel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure Label9Click(Sender: TObject);
procedure Label7Click(Sender: TObject);
private
{ Private declarations }
procedure Localize;
public
{ Public declarations }
end;
implementation
uses ShellAPI, RM_Utils, RM_Const, RM_Const1;
{$R *.DFM}
procedure TRMFormAbout.Localize;
begin
Font.Name := RMLoadStr(SRMDefaultFontName);
Font.Size := StrToInt(RMLoadStr(SRMDefaultFontSize));
Font.Charset := StrToInt(RMLoadStr(SCharset));
Caption := RMLoadStr(rmRes + 540);
lblMemorrySize.Caption := RMLoadStr(rmRes + 541);
btnOk.Caption := RMLoadStr(SOK);
end;
procedure TRMFormAbout.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
end;
function GetWindowsVersion: string;
const
sWindowsVersion = 'Windows %s %d.%.2d.%.3d %s';
var
Ver: TOsVersionInfo;
Platform: string[4];
begin
Ver.dwOSVersionInfoSize := SizeOf(Ver);
GetVersionEx(Ver);
with Ver do begin
case dwPlatformId of
VER_PLATFORM_WIN32s: Platform := '32s';
VER_PLATFORM_WIN32_WINDOWS:
begin
dwBuildNumber := dwBuildNumber and $0000FFFF;
if (dwMajorVersion > 4) or ((dwMajorVersion = 4) and
(dwMinorVersion >= 10)) then Platform := '98'
else Platform := '95';
end;
VER_PLATFORM_WIN32_NT: Platform := 'NT';
end;
Result := Trim(Format(sWindowsVersion, [Platform, dwMajorVersion,
dwMinorVersion, dwBuildNumber, szCSDVersion]));
end;
end;
procedure TRMFormAbout.FormCreate(Sender: TObject);
var
MS: TMemoryStatus;
begin
OS.Caption := GetWindowsVersion;
MS.dwLength := SizeOf(TMemoryStatus);
GlobalMemoryStatus(MS);
PhysMem.Caption := FormatFloat('#,###" KB"', MS.dwTotalPhys div 1024);
lblVersion.Caption := RM_Const1.RMCurrentVersionStr;
Localize;
end;
procedure TRMFormAbout.Label9Click(Sender: TObject);
begin
try
ShellExecute(0, nil, PChar(TLabel(Sender).Caption), nil, nil, SW_RESTORE);
except
end;
end;
procedure TRMFormAbout.Label7Click(Sender: TObject);
begin
try
ShellExecute(0, nil, PChar('mailto:' + TLabel(Sender).Caption), nil, nil, SW_RESTORE);
except
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -