Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Version de un proyecto (https://www.clubdelphi.com/foros/showthread.php?t=31374)

noshy 05-05-2006 19:51:27

Version de un proyecto
 
Hola a todos, tengo un problema y es que necesito mostrar la Version del Ejecutable en tiempo de ejecusión, yo tengo la version del proyecto en autoincremental, y quiero que al ejecutarse el proyecto me muestre la version.
Alguien sabe cual es el comando?? o la variable que la contiene??

Gracias.
Noshy

estebanx 05-05-2006 20:00:00

Esta funcion te ayudara.
Saludos
Código Delphi [-]
function Tfrmacerca.GetAppVersion: string;

 var
   Size, Size2: DWord;
   Pt, Pt2: Pointer;
  begin 
    Size := GetFileVersionInfoSize(PChar (ParamStr (0)), Size2);
    if Size > 0 then 
    begin 
      GetMem (Pt, Size);
      try
         GetFileVersionInfo (PChar (ParamStr (0)), 0, Size, Pt);
         VerQueryValue (Pt, '\', Pt2, Size2);
         with TVSFixedFileInfo (Pt2^) do 
         begin 
           Result:= ' Ver '+
                    IntToStr (HiWord (dwFileVersionMS)) + '.' +
                    IntToStr (LoWord (dwFileVersionMS)) + '.' +
                    IntToStr (HiWord (dwFileVersionLS)) + '.' +
                    IntToStr (LoWord (dwFileVersionLS));
        end; 
      finally
        FreeMem (Pt);
      end; 
    end; 
  end;

noshy 05-05-2006 20:06:05

Perfecto!!! :-)
 
Un lujo, muchisimas gracias. Solucione el problema.

Noshy


La franja horaria es GMT +2. Ahora son las 03:56:11.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi