Registriert seit: 27. Dez 2006
Ort: Melle
62 Beiträge
Delphi 5 Standard
|
Re: Versionsnummer anzeigen
6. Sep 2007, 15:17
ich mache das so
Delphi-Quellcode:
type
TFileVersionInfo = record
fCompanyName,
fFileDescription,
fFileVersion,
fInternalName,
fLegalCopyRight,
fLegalTradeMark,
fOriginalFileName,
fProductName,
fProductVersion,
fComments: string;
end;
function Get_This_EXE_Version: string;
var
VerInfoSize: DWORD;
VerInfo: Pointer;
VerValueSize: DWORD;
VerValue: PVSFixedFileInfo;
Dummy: DWORD;
begin
VerInfoSize := GetFileVersionInfoSize(PChar(ParamStr(0)), Dummy);
GetMem(VerInfo, VerInfoSize);
GetFileVersionInfo(PChar(ParamStr(0)), 0, VerInfoSize, VerInfo);
VerQueryValue(VerInfo, '\', Pointer(VerValue), VerValueSize);
with VerValue^ do
begin
Result := IntToStr(dwFileVersionMS shr 16);
Result := Result + '.' + IntToStr(dwFileVersionMS and $FFFF);
Result := Result + '.' + IntToStr(dwFileVersionLS shr 16);
Result := Result + '.' + IntToStr(dwFileVersionLS and $FFFF);
end;
FreeMem(VerInfo, VerInfoSize);
end;
Gruss Jens
|
|
Zitat
|