Try this

function GetExeVersionStr: string;
var
        Dummy: DWORD;
        FileVerInfoSize: integer;
        Buffer: PChar;
        PFFI: PVSFixedFileInfo;
        FFISize: DWORD;
begin
        FileVerInfoSize :=
GetFileVersionInfoSize(PChar(Application.EXEName), Dummy);
        if FileVerInfoSize = 0 then begin
                Result := '';
                Exit;
        end;
        GetMem(Buffer, FileVerInfoSize);
        try
                GetFileVersionInfo(PChar(Application.EXEName), 0,
FileVerInfoSize, Buffer);
                VerQueryValue(Buffer, '\', pointer(PFFI), FFISize);
                Result := Format('%d.%d.%d.%d',
[HiWord(PFFI^.dwFileVersionMS),
LoWord(PFFI^.dwFileVersionMS),
HiWord(PFFI^.dwFileVersionLS),
        
LoWord(PFFI^.dwFileVersionLS)]);
        finally
                FreeMem(Buffer, FileVerInfoSize);
        end;
end;

                -----Original Message-----
                From:   [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
                Sent:   Friday, April 23, 1999 2:23 PM
                To:     Multiple recipients of list delphi
                Subject:        [DUG]:  Application version information

                Quick Friday question,

                I want to display an application's version information
on its About form. Ideally, I want to be able to extract this
information from the project's version information rather than
maintaining a constant value. This value is set-up via the
Project/Options/Version Info tab. The version information is then
accessible within Windows by right-clicking on the .exe file and
choosing properties. But the question is; how do I access this
information within the application itself? I've looked at the properties
of TApplication, but I couldn't see anything that would give me access
to what I'm after.

                Any suggestions most gratefully accepted.

                James.


        
------------------------------------------------------------------------
---
                    New Zealand Delphi Users group - Delphi List -
[EMAIL PROTECTED]
                                  Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to