charin1904
asked on
How do I get System Path(Desktop) with Delphi2010?
function GetSystemPath(Folder: Integer): string;
var
PIDL: PItemIDList;
Path: LPSTR;
AMalloc: IMalloc;
begin
Path := StrAlloc(MAX_PATH);
SHGetSpecialFolderLocation(Application.Handle, Folder, PIDL);
if SHGetPathFromIDList(PIDL, Path) then Result := Path;
SHGetMalloc(AMalloc);
AMalloc.Free(PIDL);
StrDispose(Path);
end;
Usage:
Showmessage(GetSystemPath( CSIDL_DESK TOPDIRECTO RY));
--------------------------
I normaly use function above on Delphi7, How do i convert it into Delphi 2010?
Thanks Expert!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Thommy,
I"m sorry, question not clear, I need a "Desktop" Folder not system's folder :)
It something like: C:\Users\Charin\Desktop
How do i get it?
I"m sorry, question not clear, I need a "Desktop" Folder not system's folder :)
It something like: C:\Users\Charin\Desktop
How do i get it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you for the points...
:o)))
:o)))
ASKER
I got solution guided by Thommy.
Open in new window