📄 u_about.pas
字号:
unit u_about;interfaceuses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, Buttons, ExtCtrls;type TF_about = class(TForm) Panel1: TPanel; ProgramIcon: TImage; ProductName: TLabel; Version: TLabel; Copyright: TLabel; Comments: 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -