Hallo,
folgendes funktioniert unter
W2K und XP:
Delphi-Quellcode:
uses
SHFolders, SysUtils;
...
// aID: CSIDL_PERSONAL = My Documents
// CSIDL_MYPICTURES = My Pictures
function GetPfad(aID:Integer):String;
var p:PChar;
begin
p:=nil;
try
p:=AllocMem(MAX_PATH);
if (SHGetFolderPath(0, aID, 0, 0, p)=S_OK) then Result:=p
else Result:=GetCurrentDir;
Result:=IncludeTrailingPathDelimiter(Result);
finally
FreeMem(p);
end; // try
end; // GetPfad
...
var bildPfad:String;
...
bildPfad:=GetPfad(CSIDL_MYPICTURES);
...