u_about.pas

来自「酒店管理系统的代码和报告 可以直接下载使用!」· PAS 代码 · 共 62 行

PAS
62
字号
unit u_about;

interface

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

type
  TF_about = class(TForm)
    Panel1: TPanel;
    ProgramIcon: TImage;
    ProductName: TLabel;
    Version: TLabel;
    OKButton: TButton;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  F_about: TF_about;

implementation

{$R *.DFM}

procedure TF_about.FormCreate(Sender: TObject);
var
  Handle:DWord;
  Size:Integer;
  RezBuffer:String;
  SBSize:UInt;
  FileName:String;
  VerInfo:String;
  FixedFileInfoBuf:PVSFixedFileInfo;
  Ms,Ls:LongInt;
begin
  ProductName.Caption:=Application.Title;
  //获取当前文件名
  FileName:=Application.ExeName;
  //获取版本信息大小
  Size:=GetFileVersionInfoSize(PChar(FileName), Handle);
  if Size>0 then
  begin
    //设置字符串大小
    SetLength(RezBuffer, Size);
    //获取版本信息
    GetFileVersionInfo(PChar(FileName), Handle, Size, PChar(RezBuffer));
    //提取版本号
    VerQueryValue(PChar(RezBuffer), '\', Pointer(FixedFileInfoBuf), SBSize);
    Ms:=FixedFileInfoBuf^.dwFileVersionMS;
    Ls:=FixedFileInfoBuf^.dwFileVersionLS;
    VerInfo:=Format('%d.%d.%d.%d', [HIWORD(Ms), LOWORD(Ms), HIWORD(Ls), LOWORD(Ls)]);
    Version.Caption:='Version '+VerInfo;
  end;
end;

end.
 

⌨️ 快捷键说明

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