SHGetFolderLocation

[DllImport("shell32.dll")]
public static extern int SHGetFolderLocation(
   IntPtr hwnd,
   int nFolder,
   IntPtr hToken,
   uint dwReserved,
   out IntPtr ppidl
);

Microsoft documentation: Link

Last updated