Esempio n. 1
0
        private IImage GetFileIconWindows(String fileName, uint fileFlags, uint flags, UIEngine engine, bool large)
        {
            SHFileInfo shellInfo = new SHFileInfo();

            IntPtr status = SHGetFileInfo(UIUtils.ConvertToWindows(fileName), fileFlags, ref shellInfo, (uint)Marshal.SizeOf(shellInfo), flags);

            if (IntPtr.Zero != status)
            {
                IntPtr hIcon = shellInfo.hIcon;

                IImage texture = GetIconWindows(hIcon, engine, large);

                DestroyIcon(hIcon);

                return(texture);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        private IImage GetFileIconWindows(String fileName, uint fileFlags, uint flags, UIEngine engine, bool large)
        {
            SHFileInfo shellInfo = new SHFileInfo();

            IntPtr status = SHGetFileInfo(UIUtils.ConvertToWindows(fileName), fileFlags, ref shellInfo, (uint)Marshal.SizeOf(shellInfo), flags);

            if (IntPtr.Zero != status)
            {
                IntPtr hIcon = shellInfo.hIcon;

                IImage texture = GetIconWindows(hIcon, engine, large);

                DestroyIcon(hIcon);

                return texture;
            }
            else
            {
                return null;
            }
        }
Esempio n. 3
0
 private static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFileInfo psfi, uint cbFileInfo, uint uFlags);
Esempio n. 4
0
 private static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFileInfo psfi, uint cbFileInfo, uint uFlags);