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

📄 uabout.pas

📁 Delphi学籍管理程序,以Delphi7.0为前台开发工具
💻 PAS
字号:
unit uAbout;

interface

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

type
  TdlgAbout = class(TForm)
    Image1: TImage;
    PhysMem: TLabel;
    OS: TLabel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Bevel1: TBevel;
    BitBtn1: TBitBtn;
  private
    { Private declarations }
    procedure GetOSInfo;
    procedure InitializeCaptions;
  public
    { Public declarations }
  end;

function GetOsName:string;
procedure ShowAboutBox;

implementation

{$R *.dfm}

{ TdlgAbout }

procedure ShowAboutBox;
begin
  with TdlgAbout.Create(Application) do
  try
    InitializeCaptions;
    GetOSInfo;
    Showmodal;
  finally
    Free;
  end;
end;

function GetOsName:string;
begin
  case Win32Platform of
    VER_PLATFORM_WIN32_WINDOWS:
      begin
        Result := '95/98';
      end;
    VER_PLATFORM_WIN32_NT:
      begin
        if (Win32MajorVersion = 5) and (Win32MinorVersion = 1) then
          Result := 'XP'
        else
          Result := 'NT';
      end;
      else
      begin
        Result := '';
      end;
  end;
end;

procedure TdlgAbout.GetOSInfo;
var
  Platform: string;
  BuildNumber: Integer;
begin
  case Win32Platform of
    VER_PLATFORM_WIN32_WINDOWS:
      begin
        Platform := 'Windows 95/98';
        BuildNumber := Win32BuildNumber and $0000FFFF;
      end;
    VER_PLATFORM_WIN32_NT:
      begin
        if (Win32MajorVersion = 5) and (Win32MinorVersion = 1) then
          Platform := 'Windows XP'
        else
          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 TdlgAbout.InitializeCaptions;
var
  MS: TMemoryStatus;
begin
  GetOSInfo;
  MS.dwLength := SizeOf(TMemoryStatus);
  GlobalMemoryStatus(MS);
  PhysMem.Caption := FormatFloat('#,###" KB"', MS.dwTotalPhys div 1024);
end;

end.

⌨️ 快捷键说明

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