Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   SHGetSpecialFolderLocation unter Vista (https://www.delphipraxis.net/135167-shgetspecialfolderlocation-unter-vista.html)

Luckie 5. Jun 2009 21:34


SHGetSpecialFolderLocation unter Vista
 
Ich benutze folgende Funktion, um Systemordner zu ermitteln:
Delphi-Quellcode:
function GetShellFolder(CSIDL: integer): string;
var
  pidl             : PItemIdList;
  FolderPath       : string;
  SystemFolder     : Integer;
begin
  FolderPath := '';
  SystemFolder := CSIDL;
  if SUCCEEDED(SHGetSpecialFolderLocation(0, SystemFolder, pidl)) then
  begin
    SetLength(FolderPath, MAX_PATH);
    SHGetPathFromIDList(pidl, PChar(FolderPath));
    SetLength(FolderPath, lstrlen(PChar(FolderPath)));
  end;
  Result := FolderPath;
end;
Unter XP liefert mir CSIDL_APPDATA das Appdata Verzeichnis den Benutzers. Unter Vista aber C:\Users\Michael\AppData\Roaming\. Wie bekomme ich das AppData Verzeichnis ohne Roaming?

Es handelt sich um 32-Bit Vista.

Es scheint eine neue CSIDL zu geben: CSIDL_LOCAL_APPDATA:
Zitat:

The file system directory that serves as a data repository for local (nonroaming) applications. A typical path is C:\Documents and Settings\username\Local Settings\Application Data.
Als ich meine LuckieDIPS geschrieben habe, gab es die CSIDL, glaube ich noch nicht.

mkinzler 5. Jun 2009 21:40

Re: SHGetSpecialFolderLocation unter Vista
 
Das ist doch der entsprechende Pfad

quendolineDD 5. Jun 2009 21:40

Re: SHGetSpecialFolderLocation unter Vista
 
Da steht am Anfang auch
Zitat:

Note In Windows Vista, these values have been replaced by KNOWNFOLDERID values.
Und die neuen sind KNOWNFOLDERID's.

Luckie 5. Jun 2009 21:53

Re: SHGetSpecialFolderLocation unter Vista
 
Zitat:

Zitat von mkinzler
Das ist doch der entsprechende Pfad

Ja aber nicht mit der alten CSIDL mit der CSIDL_LOCAL_APPDATA sollte es gehen.

@quendolineDD: Danke für den Hinweis. Werde ich mir mal angucken.


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:45 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz