Registriert seit: 14. Apr 2003
Ort: Stuttgart
1.701 Beiträge
Delphi 7 Professional
|
11. Mai 2003, 22:31
ich habe in der delphi hilfe
unter
version ->
Reading version information-- Delphi example
das gefunden :
Code:
procedure TForm1.Button1Click(Sender: TObject);
const
InfoNum = 10;
InfoStr: array[1..InfoNum] of string = ('CompanyName', 'FileDescription', 'FileVersion', 'InternalName', 'LegalCopyright', 'LegalTradeMarks', 'OriginalFileName', 'ProductName', 'ProductVersion', 'Comments');
var
S: string;
n, Len, i: DWORD;
Buf: PChar;
Value: PChar;
begin
S := Application.ExeName;
n := GetFileVersionInfoSize(PChar(S), n);
if n > 0 then
begin
Buf := AllocMem(n);
Memo1.Lines.Add('VersionInfoSize = ' + IntToStr(n));
GetFileVersionInfo(PChar(S), 0, n, Buf);
for i := 1 to InfoNum do
if VerQueryValue(Buf, PChar('StringFileInfo\040904E4\' + InfoStr[i]), Pointer(Value), Len) then
Memo1.Lines.Add(InfoStr[i] + ' = ' + Value);
FreeMem(Buf, n);
end
else
Memo1.Lines.Add('No version information found');
end;
|
|
Zitat
|