Einzelnen Beitrag anzeigen

hathor
(Gast)

n/a Beiträge
 
#2

Re: Welchen Special Folder für Anwendungsdaten unter 98-Vist

  Alt 22. Okt 2007, 20:14
Delphi-Quellcode:
function GetSpecialFolder(hWindow: HWND; Folder: Integer): String;
var
pMalloc: IMalloc;
pidl: PItemIDList;
Path: PChar;
begin
// get IMalloc interface pointer
if (SHGetMalloc(pMalloc) <> S_OK) then
begin
MessageBox(hWindow, 'Couldn''t get pointer to IMalloc interface.','SHGetMalloc(pMalloc)', 16);
Exit;
end;
// retrieve path
SHGetSpecialFolderLocation(hWindow, Folder, pidl);
GetMem(Path, MAX_PATH);
SHGetPathFromIDList(pidl, Path);
Result := Path;
FreeMem(Path);

// free memory allocated by SHGetSpecialFolderLocation
pMalloc.Free(pidl);
end;

//Damit kann man feststellen, welche Ordner verwendet werden von WINDOWS:
for i := 0 to 64 do Memo1.Lines.add(IntToStr(i)+' : '+ GetSpecialFolder(Form1.Handle,i));
  Mit Zitat antworten Zitat