SHGetSpecialFolderPath (coredll)
Last changed: -199.255.40.36

.
Summary
This function retrieves the path of a special folder, identified by its CSIDL. (From MSDN)

C# Signature:

[DllImport("coredll.dll")]
static extern int SHGetSpecialFolderPath(IntPtr hwndOwner, StringBuilder lpszPath, int nFolder, int fCreate);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

None.

Sample Code:

    const int CSIDL_PROGRAMS = 2;  // \Windows\Start Menu\Programs
    StringBuilder programs = new StringBuilder(255);
    SHGetSpecialFolderPath((IntPtr)0, programs, PlatformUtil.CSIDL_PROGRAMS, 0);
    string programsDir = programs.ToString();

Alternative Managed API:

None in the Compact Framework

Documentation