Ver Mensaje Individual
  #3  
Antiguo 22-03-2011
Avatar de rastafarey
rastafarey rastafarey is offline
Miembro
 
Registrado: nov 2003
Posts: 927
Reputación: 21
rastafarey Va por buen camino
Resp

haber si esto te sirve.
Código Delphi [-]
unit AplicacionInfo;

interface
uses Windows, Classes, SysUtils;

type
  TVersionInfo = class(TObject)
  private
    FData: Pointer;
    FSize: Cardinal;
    FNombreCompania: string;
    FDescripcionDelArchivo: string;
    FVersionDelArchivo: string;
    FNombreInterno: string;
    FDerechosDeCopiado: string;
    FMarcasRegistradas: string;
    FNombreOriginalDelArchivo: string;
    FNombreDelProducto: string;
    FVersionDelProducto: string;
    FComentarios: string;
    FVersionInterna: Integer;
  public
    constructor Create(FileName: string); Overload;
    constructor Create; Overload;
    destructor Destroy; override;
    property NombreCompania: string read FNombreCompania;
    property DescripcionDelArchivo: string read FDescripcionDelArchivo;
    property VersionDelArchivo: string read FVersionDelArchivo;
    property NombreInterno: string read FNombreInterno;
    property DerechosDeCopiado: string read FDerechosDeCopiado;
    property MarcasRegistradas: string read FMarcasRegistradas;
    property NombreOriginalDelArchivo: string read FNombreOriginalDelArchivo;
    property NombreDelProducto: string read FNombreDelProducto;
    property VersionDelProducto: string read FVersionDelProducto;
    property Comentarios: string read FComentarios;
    property VersionInterna: Integer read FVersionInterna;
  end;

implementation
{ TVersionInfo }

constructor TVersionInfo.Create(FileName: string);
var
  sz, lpHandle, tbl: Cardinal;
  lpBuffer: Pointer;
  str: PChar;
  strtbl: string;
  int: PInteger;
  hiW, loW: Word;
  Function Leer(Const pcValor: String): String;
  Begin
    VerQueryValue(FData, PChar('\\StringFileInfo\' + strtbl + pcValor), lpBuffer, sz);
    str := lpBuffer;
    Result := str;
  End;
begin
  inherited Create;
  FSize := GetFileVersionInfoSize(PChar(FileName), lpHandle);
  FData := AllocMem(FSize);
  GetFileVersionInfo(PChar(FileName), lpHandle, FSize, FData);

  VerQueryValue(FData, '\\VarFileInfo\Translation', lpBuffer, sz);
  int := lpBuffer;
  hiW := HiWord(int^);
  loW := LoWord(int^);
  tbl := (loW shl 16) or hiW;
  strtbl := Format('%x', [tbl]);
  if Length(strtbl) < 8 then
    strtbl := '0' + strtbl;

  FNombreCompania := Leer('\CompanyName');
  FDescripcionDelArchivo := Leer('\FileDescription');
  FVersionDelArchivo := Leer('\FileVersion');
  FNombreInterno := Leer('\InternalName');
  FDerechosDeCopiado := Leer('\LegalCopyright');
  FMarcasRegistradas := Leer('\LegalTrademarks');
  FNombreOriginalDelArchivo := Leer('\OriginalFilename');
  FNombreDelProducto := Leer('\ProductName');
  FVersionDelProducto := Leer('\ProductVersion');
  FComentarios := Leer('\Comments');
  FVersionInterna := StrToInt(Leer('\VersionInterna'));
end;

constructor TVersionInfo.Create;
begin
  Create(ParamStr(0));
end;

destructor TVersionInfo.Destroy;
begin
  FreeMem(FData);
  inherited;
end;

end.
__________________
Todo se puede, que no exista la tecnología aun, es otra cosa.
Responder Con Cita