Einzelnen Beitrag anzeigen

Furtbichler
(Gast)

n/a Beiträge
 
#2

AW: TcxPropertiesStore > in AppData speichern

  Alt 14. Sep 2012, 07:21
Wieso löst Du 'AppData' nicht einfach selbst auf?
Delphi-Quellcode:
Function LocalAppDataPath(AppNameWithoutExtension: String): String;
Begin
  Result := IncludeTrailingPathDelimiter(GetSpecialFolderLocation(CSIDL_LOCAL_APPDATA));
  Result := IncludeTrailingPathDelimiter(Result + AppNameWithoutExtension);
  ForceDirectories(Result)
End;

Function GetSpecialFolderLocation(csidl: integer): String;
Var
  pMalloc: IMalloc;
  pidl: PItemIDList;
  path: Array[0..MAX_PATH] Of Char;

Begin
  Result := '?';
  If SHGetMalloc(pMalloc) = S_OK Then
    Try
      SHGetSpecialFolderLocation(0, csidl, pidl);
      SHGetPathFromIDList(pidl, path);
      Result := IncludeTrailingPathDelimiter(Path);
    Finally
      pMalloc.Free(pidl);
    End;
End;
  Mit Zitat antworten Zitat