uses shlobj, activeX;
ShGetSpecialFolderLocation
procedure FreePidl(pidl: PItemIDList);
begin
CoTaskMemFree(pidl);
end;
procedure TForm1.Button1Click(Sender: TObject);
Var
pidl: PItemIDList;
buf: Array[0..MAX_PATH] of Char;
begin
If Succeeded( ShGetSpecialFolderLocation( Handle, CSIDL_PERSONAL, pidl ))
Then Begin
If ShGetPathfromIDList( pidl, buf ) Then
ShowMessage( buf );
FreePIDL( pidl );
End;
end;