Пример #1
0
 public static Icon GetDirectoryIcon(string name)
 {
     var shinfo = new SHFILEINFO();
     var hImgSmall = Win32.SHGetFileInfo(name, 0, ref shinfo,
                           (uint)Marshal.SizeOf(shinfo),
                            Win32.SHGFI_ICON |
                            Win32.SHGFI_SMALLICON);
     var myIcon = (Icon)Icon.FromHandle(shinfo.hIcon).Clone();
     Win32.DestroyIcon(shinfo.hIcon);
     return myIcon;
 }
Пример #2
0
 public static extern IntPtr SHGetFileInfo(string pszPath,
                       uint dwFileAttributes,
                       ref SHFILEINFO psfi,
                       uint cbSizeFileInfo,
                       uint uFlags);