Gracias por la solucion. Asi si quedo mi Unit y la llamada
Código Delphi
[-]type
TGeneralFiles = class
FAppName: string;
private
function GetAppVersion: string;
public
property Versao: string read GetAppVersion write FAppName;
constructor Create;
end;
implementation
constructor TGeneralFiles.Create;
begin
FAppName := Application.ExeName;
end;
function TGeneralFiles.GetAppVersion: string;
var
Size, Size2: DWord;
Pt, Pt2: Pointer;
begin
Size := GetFileVersionInfoSize(PChar(FAppName), Size2);
if Size > 0 then
begin
GetMem (Pt, Size);
try
GetFileVersionInfo (PChar (FAppName), 0, Size, Pt);
VerQueryValue (Pt, '\', Pt2, Size2);
with TVSFixedFileInfo (Pt2^) do
begin
Result:= ' Versão: '+
IntToStr (HiWord (dwFileVersionMS)) + '.' +
IntToStr (LoWord (dwFileVersionMS)) + '.' +
IntToStr (HiWord (dwFileVersionLS)) + '.' +
IntToStr (LoWord (dwFileVersionLS));
end;
finally
FreeMem (Pt);
end;
end;
end;
end.
Código Delphi
[-]procedure TfrmMain.FormCreate(Sender: TObject);
begin
FGeneralFiles := TGeneralFiles.Create;
end;
Código Delphi
[-]procedure TfrmMain.FormShow(Sender: TObject);
begin
Self.Caption := Self.Caption + ' - ' + FGeneralFiles.Versao;
end;
Ya estas resuelto.