Logo

  DELPHI - FAQ

  Delphi-FAQ | Allgemeine Tipps | Grafik | Datenbanken | VCL | DLL-Programmierung |
 
  Delphi-FAQ | DLL-Programmierung |
  String aus der Versionsinformation einer DLL auslesen

function GetVersionDLL(dll: string; aName: string): string;
var
  l                 : integer;
  h                 : THandle;
  p                 : PChar;
  FD                : ^LongInt;
  FP                : PChar;
  FL                : Cardinal;
  s                 : string;
begin
  Result := '';
  l := GetFileVersionInfoSize(PChar(dll), h);
  if l > 0 then begin
    GetMem(p, l);
    try
      if GetFileVersionInfo(PChar(dll), 0, l, p) and
        VerQueryValue(p, '\VarFileInfo\Translation',
           Pointer(FD), FL) then begin
        s := Format('%.4x%.4x', [LoWord(FD^), HiWord(FD^)]);
        if VerQueryValue(p, PChar('\StringFileInfo\' + s
             + '\' + aName), Pointer(FP), FL) then
          Result := FP;
      end;
    finally
      FreeMem(P, l);
    end;
  end;
end;
Siehe auch: Versionsnummer einer DLL auslesen



 26.01.2006 © wlsoft www.wlsoft.de