private int GetIconIndex(GILI iconAttrs) { if (_iconIndex != UndefinedIconIndex) { return(_iconIndex); } if (IsDesktop) { using (PIDLIST desktopPidl = Native.SHGetKnownFolderIDList(FOLDERID.Desktop)) return(_iconIndex = Native.SHGetFileInfo(desktopPidl, SHGFI.SYSICONINDEX).iIcon); } Dispatcher.InvokeAsync( () => { int iconIndex; using (NativeShellIcon shellIcon = ParentShellFolder.QueryInterface <IShellIcon>().ToNative()) iconIndex = shellIcon != null ? _tree.IconList.GetIconIndex(shellIcon, _pidl, iconAttrs) : UnindexableIconIndex; Set(ref _iconIndex, iconIndex, "IconSmall", "IconLarge", "IconExtraLarge", "IconJumbo"); }, DispatcherPriority.Background); return(NoIconIndex); }
public ImageSource GetIcon(NativeShellIcon shellIcon, PIDLIST pidl, SHIL iconSize, GILI iconFlags) { return(GetIconByIndex(iconSize, GetIconIndex(shellIcon, pidl, iconFlags))); }
public int GetIconIndex(NativeShellIcon shellIcon, PIDLIST pidl, GILI iconFlags) { return(shellIcon.GetIconOf(pidl, iconFlags)); }