Example #1
0
        public static string GetSpecialFolderCLSID(int folder, bool fDisplayName)
        {
            IntPtr ptr;

            if ((PInvoke.SHGetFolderLocation(IntPtr.Zero, folder, IntPtr.Zero, 0, out ptr) == 0) && (ptr != IntPtr.Zero))
            {
                string displayName = GetDisplayName(ptr, fDisplayName);
                PInvoke.CoTaskMemFree(ptr);
                return(displayName);
            }
            return(string.Empty);
        }