Ver Mensaje Individual
  #2  
Antiguo 13-09-2005
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Lo siguiente es una adaptación del truco "Obtener la version de tu aplicacion definida desde el IDE Delphi" que puede hallarse en TrucoMania.

Código Delphi [-]
 function GetExeVersion(exePath: string) : string;
 var
   Size, Size2: DWord;
   Pt, Pt2: Pointer;
 begin
   if not FileExists(exePath) then Exit;
   Size := GetFileVersionInfoSize(PChar (exePath), Size2);
   if Size > 0 then
   begin
     GetMem (Pt, Size);
     try
       GetFileVersionInfo (PChar (exePath), 0, Size, Pt);
       VerQueryValue (Pt, '\', Pt2, Size2);
       with TVSFixedFileInfo (Pt2^) do
       begin
         Result:= IntToStr (HiWord (dwFileVersionMS)) + '.' +
                  IntToStr (LoWord (dwFileVersionMS)) + '.' +
                  IntToStr (HiWord (dwFileVersionLS)) + '.' +
                  IntToStr (LoWord (dwFileVersionLS));
       end;
     finally
       FreeMem (Pt);
     end;
   end;
 end;
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita