Ver Mensaje Individual
  #5  
Antiguo 21-03-2011
Paulao Paulao is offline
Miembro
 
Registrado: sep 2003
Ubicación: Rua D 31 Casa 1 - Inhoaíba - Rio de Janeiro - RJ - Brasil
Posts: 637
Reputación: 21
Paulao Va por buen camino
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

{ GeneralFiles }

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.
Responder Con Cita