Einzelnen Beitrag anzeigen

Popov
(Gast)

n/a Beiträge
 
#4

Re: Pfad der "Special Folders" ermitteln

  Alt 24. Nov 2007, 14:41
Allerdings kriegt man das auch kürzer mit SHGetSpecialFolderLocation als oben

Delphi-Quellcode:
function SpecialDirectory(ID: Integer): String; // uses Windows, Shlobj;
var
  pidl : PItemIDList;
  Path : PChar;
begin
  if SUCCEEDED(SHGetSpecialFolderLocation(0, ID, pidl)) then
  begin
    Path := StrAlloc(max_path);
    SHGetPathFromIDList(pidl, Path);
    Result := String(Path);
  end
    else Result := #0;
end;
  Mit Zitat antworten Zitat