API Delphi

Question:
How can I get the default Windows folders?
Answer:
The following example demonstrates retrieving the entire list of
default shell folders to a TMemo component. The folders retrieved
should include: Favorites, Desktop, Programs, Fonts, SendTo, Start
Menu, Templates, Startup, Recent and NetHood.
Example:
uses Registry;
procedure TForm1.Button1Click(Sender: TObject);
var
reg : TRegistry;
ts : TStrings;
i : integer;
begin
reg := TRegistry.Create;
reg.RootKey := HKEY_CURRENT_USER;
reg.LazyWrite := false;
reg.OpenKey(
'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
false);
ts := TStringList.Create;
reg.GetValueNames(ts);
for i := 0 to ts.Count -1 do begin
Memo1.Lines.Add(ts.Strings[i] +
' = ' +
reg.ReadString(ts.Strings[i]));
end;
ts.Free;
reg.CloseKey;
reg.free;
end;