unit fROAbout; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TAboutForm = class(TForm) Image1: TImage; Label1: TLabel; Label3: TLabel; btn_Cancel: TButton; lbl_Version: TLabel; Label7: TLabel; procedure OnCloseClick(Sender: TObject); procedure Label3Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; function VersionBuildNo(iInstance:THandle):integer; var AboutForm: TAboutForm; sVersionName : string = ''; implementation uses ShellAPI; {$R *.dfm} type TVersion = record Major,Minor,Release,Build:word; end; function GetFileVersion(iFileName:string):TVersion; var whocares:dword; Size:dword; Data:pointer; FixedData:pVSFixedFileInfo; begin Size := GetFileVersionInfoSize(pChar(iFileName), whocares); if Size > 0 then begin GetMem(Data,Size); try if GetFileVersionInfo(pChar(iFileName),0,Size,Data) then begin Size := sizeof(TVSFixedFileInfo); if VerQueryValue(Data,'\',pointer(FixedData),Size) then begin result.Major := HiWord(FixedData^.dwFileVersionMS); result.Minor := LoWord(FixedData^.dwFileVersionMS); result.Release := HiWord(FixedData^.dwFileVersionLS); result.Build := LoWord(FixedData^.dwFileVersionLS); end; end; finally FreeMem(Data); end; end; end; function GetModuleName(iInstance:THandle):string; var Buffer: array[0..MAX_PATH] of Char; begin SetString(result, Buffer, GetModuleFileName(iInstance, Buffer, MAX_PATH)); end; function VersionStringLong:string; var Version:TVersion; begin Version := GetFileVersion(GetModuleName(hInstance)); result := IntToStr(Version.Major)+'.'+IntToStr(Version.Minor)+'.'+ IntToStr(Version.Release)+'.'+IntToStr(Version.Build){+'.'+ FormatDateTime('yymmdd', CompileTime);} end; function VersionBuildNo(iInstance:THandle):integer; var Version:TVersion; begin Version := GetFileVersion(GetModuleName(iInstance)); result := Version.Build; end; procedure TAboutForm.OnCloseClick(Sender: TObject); begin Close(); end; procedure TAboutForm.Label3Click(Sender: TObject); begin ShellExecute(Handle,'open','http://www.remobjects.com/ro',nil,nil,SW_SHOWNORMAL); end; procedure TAboutForm.FormCreate(Sender: TObject); begin lbl_Version.Caption := 'Version '+VersionStringLong(); if sVersionName <> '' then lbl_Version.Caption := sVersionName+' - '+lbl_Version.Caption; btn_Cancel.Left := Width+10; end; end.