/// <summary>
        /// �˷������ڻ��һ���ļ����͵�����
        /// </summary>
        /// <param name="path">�ļ���·��</param>
        /// <returns></returns>
        public static string GetFileTypeName(string filePath)
        {
            if (!File.Exists(filePath))
            {
                throw new FileNotFoundException(filePath);
            }

            try
            {
                SHFILEINFO fileInfo = new SHFILEINFO();
                int cbFileInfo = Marshal.SizeOf(fileInfo);
                uint dwflag = (uint)(FileInfoFlags.SHGFI_TYPENAME | FileInfoFlags.SHGFI_USEFILEATTRIBUTES);

                uint dwAttr = (uint)FileAttributeFlags.FILE_ATTRIBUTE_NORMAL;
                IntPtr hr = ManagedSHGetFileInfo.SHGetFileInfo(filePath, dwAttr, ref fileInfo,
                    (uint)Marshal.SizeOf(fileInfo), dwflag);
                return fileInfo.szTypeName;
            }
            catch (Exception e)
            {
                throw e;
            }
        }
        /// <summary>
        /// ���һ��Ӧ�ó�����ʾ�����ƣ����硰�ҵĵ��ԡ���������վ���ȵ�
        /// </summary>
        public static void FetchProcDisplayName()
        {
            IntPtr pidl1 = IntPtr.Zero;
            int result = SHGetFolderLocation(IntPtr.Zero,
                (int)CSIDLFlags.CSIDL_BITBUCKET,
                IntPtr.Zero,
                0,
                out pidl1);

            if (result == S_OK)
            {
                SHFILEINFO fileInfo = new SHFILEINFO();

                string filePath = Marshal.PtrToStringAuto(pidl1); //�����ָ��CSIDL��·��
                ManagedSHGetFileInfo.SHGetFileInfo(filePath,
                    0,
                    ref fileInfo,
                    (uint)Marshal.SizeOf(fileInfo),
                    (uint)(FileInfoFlags.SHGFI_PIDL |
                    FileInfoFlags.SHGFI_DISPLAYNAME));

                Console.WriteLine(fileInfo.szDisplayName);
            }

            // �ͷ�pidl1
            ILFree(pidl1);
        }
        /// <summary>
        /// ����ļ���ͼ��
        /// </summary>
        /// <param name="filePath">�ļ���·��</param>
        /// <param name="linkOverlay">�Ƿ���ʾͼ���ϵĿ�ݷ�ʽС��ͷ</param>
        /// <param name="iconSize">Ҫ��ʾ��ͼ���С</param>
        /// <returns></returns>
        public static Icon GetFileIcon(string filePath, bool linkOverlay, IconSize iconSize)
        {
            if (!File.Exists(filePath))
            {
                throw new FileNotFoundException(filePath);
            }

            SHFILEINFO fileInfo = new SHFILEINFO();
            uint dwflags = (uint)(FileInfoFlags.SHGFI_ICON | FileInfoFlags.SHGFI_USEFILEATTRIBUTES);

            if (linkOverlay)
            {
                dwflags += (uint)FileInfoFlags.SHGFI_LINKOVERLAY;
            }

            if (iconSize == IconSize.Small)
            {
                dwflags += (uint)FileInfoFlags.SHGFI_SMALLICON;
            }
            else if (iconSize == IconSize.Large)
            {
                dwflags += (uint)FileInfoFlags.SHGFI_LARGEICON;
            }

            ManagedSHGetFileInfo.SHGetFileInfo(filePath,
                (uint)FileAttributeFlags.FILE_ATTRIBUTE_NORMAL,
                ref fileInfo,
                (uint)Marshal.SizeOf(fileInfo),
                dwflags);

            // ��Win32 API�������ص�ͼ�꿽�����й�Icon������
            Icon icon = (Icon)Icon.FromHandle(fileInfo.hIcon).Clone();

            // ʹ��Win32 API�����ͷŵ����ͼ��
            DestroyIcon(fileInfo.hIcon);

            return icon;
        }
 public static extern IntPtr SHGetFileInfo(
     string pszPath,
     uint dwFileAttributes,
     ref SHFILEINFO psfi,
     uint cbFileInfo,
     uint uFlags);