14 changed files
BExplorer/BetterExplorer/ArchiveView | ||
SysImageList.cs | ||
Shell | ||
Interop | ||
BHID.cs | ||
Constants.cs | ||
FileIcon.cs | ||
ShellLink.cs | ||
ShellThumbnail.cs | ||
KnownFolders | ||
FileSystemKnownFolder.cs | ||
FileNameComboBox.cs | ||
FOperationProgressSink.cs | ||
ShellLibrary.cs | ||
ShellViewEx.cs | ||
TabControl | ||
TabPanel.cs | ||
WpfControlLibrary1 | ||
PreviewPane.xaml.cs | ||
SearchBox.xaml.cs | ||
SysImageList.cs
/BExplorer/BetterExplorer/ArchiveView/SysImageList.cs-1+1/BExplorer/BetterExplorer/ArchiveView/SysImageList.cs
Add comment 447 /// <summary>
Add comment 448 /// Gets the hImageList handle
Add comment 449 /// </summary>
Add comment 450 Minus public IntPtr Handle { get { return this.hIml; } }
Add comment 450 Plus public IntPtr Handle => this.hIml;
Add comment 451
Add comment 452 /// <summary>
Add comment 453 /// Gets/sets the size of System Image List to retrieve.
Add comment 17 // Boston, MA 2110-1301, USA.
Add comment 18 //
Add comment 19 using System;
Add comment 20 Minus using System.Collections.Generic;
Add comment 21 Minus using System.Text;
Add comment 22 20
Add comment 23 21 #pragma warning disable 1591
Add comment 24 22
Add comment 25 Minus namespace BExplorer.Shell.Interop {
Add comment 26 Minus public class BHID {
Add comment 27 Minus public static Guid SFObject { get { return m_SFObject; } }
Add comment 28 Minus public static Guid SFUIObject { get { return m_SFUIObject; } }
Add comment 29 Minus public static Guid SFAssocHandlers { get { return m_SFAssocHandlers; } }
Add comment 30 Minus
Add comment 31 Minus static Guid m_SFObject = new Guid("3981e224-f559-11d3-8e3a-00c04f6837d5");
Add comment 32 Minus static Guid m_SFUIObject = new Guid("3981e225-f559-11d3-8e3a-00c04f6837d5");
Add comment 33 Minus static Guid m_SFAssocHandlers = new Guid("b8ab0b9c-c2ec-4f7a-918d-314900e6280a");
Add comment 23 Plus namespace BExplorer.Shell.Interop
Add comment 24 Plus {
Add comment 25 Plus public class BHID
Add comment 26 Plus {
Add comment 27 Plus public static Guid SFObject { get; } = new Guid("3981e224-f559-11d3-8e3a-00c04f6837d5");
Add comment 28 Plus public static Guid SFUIObject { get; } = new Guid("3981e225-f559-11d3-8e3a-00c04f6837d5");
Add comment 29 Plus public static Guid SFAssocHandlers { get; } = new Guid("b8ab0b9c-c2ec-4f7a-918d-314900e6280a");
Add comment 34 30 }
Add comment 35 31 }
Add comment 36 32
Add comment 6 using System.Text;
Add comment 7 using System.Threading.Tasks;
Add comment 8
Add comment 9 Minus namespace BExplorer.Shell.Interop {
Add comment 9 Plus namespace BExplorer.Shell.Interop
Add comment 10 Plus {
Add comment 10 11
Add comment 11 Minus public static class InterfaceGuids {
Add comment 12 Plus public static class InterfaceGuids
Add comment 13 Plus {
Add comment 12 14 // IID GUID strings for relevant Shell COM interfaces.
Add comment 13 15 public const string IExplorerBrowser = "DFD3B6B5-C10C-4BE9-85F6-A66969F402F6";
Add comment 14 16 public const string IKnownFolderManager = "8BE2D872-86AA-4d47-B776-32CCA40C7018";
Add comment 86 88
Add comment 87 89 }
Add comment 88 90
Add comment 89 Minus public static class WNM {
Add comment 91 Plus public static class WNM
Add comment 92 Plus {
Add comment 90 93 const int NM_FIRST = 0;
Add comment 91 94 public const int NM_KILLFOCUS = (NM_FIRST - 8);
Add comment 92 95 public const int NM_CUSTOMDRAW = (NM_FIRST - 12);
Add comment 130 133 public const int UDN_DELTAPOS = (UDN_FIRST - 1);
Add comment 131 134 }
Add comment 132 135
Add comment 133 Minus public static class LVM {
Add comment 134 Minus const int FIRST = 0x1000; // LVM_FIRST
Add comment 135 Minus public const int SETIMAGELIST = (FIRST + 3); // LVM_SETIMAGELIST
Add comment 136 Minus public const int GETNEXTITEM = (FIRST + 12); // LVM_GETNEXTITEM
Add comment 136 Plus public static class LVM
Add comment 137 Plus {
Add comment 138 Plus const int FIRST = 0x1000; // LVM_FIRST
Add comment 139 Plus public const int SETIMAGELIST = (FIRST + 3); // LVM_SETIMAGELIST
Add comment 140 Plus public const int GETNEXTITEM = (FIRST + 12); // LVM_GETNEXTITEM
Add comment 137 141 public const int GETNEXTITEMINDEX = (FIRST + 211);
Add comment 138 Minus public const int GETITEMRECT = (FIRST + 14); // LVM_GETITEMRECT
Add comment 139 Minus public const int HITTEST = (FIRST + 18); // LVM_HITTEST
Add comment 140 Minus public const int REDRAWITEMS = (FIRST + 21); // LVM_REDRAWITEMS
Add comment 141 Minus public const int GETEDITCONTROL = (FIRST + 24); // LVM_GETEDITCONTROL
Add comment 142 Minus public const int GETHEADER = (FIRST + 31); // LVM_GETHEADER
Add comment 143 Minus public const int GETITEMSTATE = (FIRST + 44); // LVM_GETITEMSTATE
Add comment 144 Minus public const int GETITEMSPACING = (FIRST + 51); // LVM_GETITEMSPACING
Add comment 145 Minus public const int SETEXTENDEDLISTVIEWSTYLE = (FIRST + 54); // LVM_SETEXTENDEDLISTVIEWSTYLE
Add comment 146 Minus public const int GETEXTENDEDLISTVIEWSTYLE = (FIRST + 55); // LVM_GETEXTENDEDLISTVIEWSTYLE
Add comment 147 Minus public const int GETSUBITEMRECT = (FIRST + 56); // LVM_GETSUBITEMRECT
Add comment 148 Minus public const int GETHOTITEM = (FIRST + 61); // LVM_GETHOTITEM
Add comment 149 Minus public const int GETITEMW = (FIRST + 75); // LVM_GETITEMW
Add comment 150 Minus public const int GETSTRINGWIDTHW = (FIRST + 87); // LVM_GETSTRINGWIDTHW
Add comment 151 Minus public const int SETBKIMAGEW = (FIRST + 138); // LVM_SETBKIMAGEW
Add comment 152 Minus public const int GETVIEW = (FIRST + 143); // LVM_GETVIEW
Add comment 153 Minus public const int SETGROUPINFO = (FIRST + 147); // LVM_SETGROUPINFO
Add comment 154 Minus public const int GETSELECTEDCOLUMN = (FIRST + 174); // LVM_GETSELECTEDCOLUMN
Add comment 155 Minus public const int SETCOLUMNWIDTH = (FIRST + 30); // LVM_SETCOLUMNWIDTH
Add comment 156 Minus public const int GETCOLUMNWIDTH = (FIRST + 29); // LVM_GETCOLUMNWIDTH
Add comment 142 Plus public const int GETITEMRECT = (FIRST + 14); // LVM_GETITEMRECT
Add comment 143 Plus public const int HITTEST = (FIRST + 18); // LVM_HITTEST
Add comment 144 Plus public const int REDRAWITEMS = (FIRST + 21); // LVM_REDRAWITEMS
Add comment 145 Plus public const int GETEDITCONTROL = (FIRST + 24); // LVM_GETEDITCONTROL
Add comment 146 Plus public const int GETHEADER = (FIRST + 31); // LVM_GETHEADER
Add comment 147 Plus public const int GETITEMSTATE = (FIRST + 44); // LVM_GETITEMSTATE
Add comment 148 Plus public const int GETITEMSPACING = (FIRST + 51); // LVM_GETITEMSPACING
Add comment 149 Plus public const int SETEXTENDEDLISTVIEWSTYLE = (FIRST + 54); // LVM_SETEXTENDEDLISTVIEWSTYLE
Add comment 150 Plus public const int GETEXTENDEDLISTVIEWSTYLE = (FIRST + 55); // LVM_GETEXTENDEDLISTVIEWSTYLE
Add comment 151 Plus public const int GETSUBITEMRECT = (FIRST + 56); // LVM_GETSUBITEMRECT
Add comment 152 Plus public const int GETHOTITEM = (FIRST + 61); // LVM_GETHOTITEM
Add comment 153 Plus public const int GETITEMW = (FIRST + 75); // LVM_GETITEMW
Add comment 154 Plus public const int GETSTRINGWIDTHW = (FIRST + 87); // LVM_GETSTRINGWIDTHW
Add comment 155 Plus public const int SETBKIMAGEW = (FIRST + 138); // LVM_SETBKIMAGEW
Add comment 156 Plus public const int GETVIEW = (FIRST + 143); // LVM_GETVIEW
Add comment 157 Plus public const int SETGROUPINFO = (FIRST + 147); // LVM_SETGROUPINFO
Add comment 158 Plus public const int GETSELECTEDCOLUMN = (FIRST + 174); // LVM_GETSELECTEDCOLUMN
Add comment 159 Plus public const int SETCOLUMNWIDTH = (FIRST + 30); // LVM_SETCOLUMNWIDTH
Add comment 160 Plus public const int GETCOLUMNWIDTH = (FIRST + 29); // LVM_GETCOLUMNWIDTH
Add comment 157 161 public const int ENSUREVISIBLE = (FIRST + 19);
Add comment 158 162 public const int ISITEMVISIBLE = (FIRST + 182);
Add comment 159 163 public const int GETTOOLTIPS = (FIRST + 78);
Add comment 188 192 }
Add comment 189 193
Add comment 190 194 [StructLayout(LayoutKind.Sequential)]
Add comment 191 Minus public struct HDITEM {
Add comment 195 Plus public struct HDITEM
Add comment 196 Plus {
Add comment 192 197 public Mask mask;
Add comment 193 198 public int cxy;
Add comment 194 199 [MarshalAs(UnmanagedType.LPTStr)]
Add comment 207 212 public uint state;
Add comment 208 213
Add comment 209 214 [Flags]
Add comment 210 Minus public enum Mask {
Add comment 215 Plus public enum Mask
Add comment 216 Plus {
Add comment 211 217 Format = 0x4, // HDI_FORMAT
Add comment 212 218
Add comment 213 219
Add comment 215 221 }
Add comment 216 222
Add comment 217 223 [Flags]
Add comment 218 Minus public enum Format {
Add comment 224 Plus public enum Format
Add comment 225 Plus {
Add comment 219 226 SortDown = 0x200, // HDF_SORTDOWN
Add comment 220 227 SortUp = 0x400, // HDF_SORTUP
Add comment 221 228 HDF_SPLITBUTTON = 0x01000000,
Add comment 223 230 }
Add comment 224 231
Add comment 225 232 [StructLayout(LayoutKind.Sequential)]
Add comment 226 Minus internal struct NativeFolderDefinition {
Add comment 233 Plus internal struct NativeFolderDefinition
Add comment 234 Plus {
Add comment 227 235 internal FolderCategory category;
Add comment 228 236 internal IntPtr name;
Add comment 229 237 internal IntPtr description;
Add comment 238 246 internal DefinitionOptions definitionOptions;
Add comment 239 247 internal Guid folderTypeId;
Add comment 240 248 }
Add comment 241 Minus
Add comment 242 Minus /*
Add comment 243 Minus [StructLayout(LayoutKind.Sequential)]
Add comment 244 Minus public struct NMITEMACTIVATE {
Add comment 245 Minus public NMHDR hdr;
Add comment 246 Minus public int iItem;
Add comment 247 Minus public int iSubItem;
Add comment 248 Minus public int uNewState;
Add comment 249 Minus public int uOldState;
Add comment 250 Minus public int uChanged;
Add comment 251 Minus public Point ptAction;
Add comment 252 Minus public IntPtr lParam;
Add comment 253 Minus public int uKeyFlags;
Add comment 254 Minus }
Add comment 255 Minus */
Add comment 256 249
Add comment 257 Minus /*
Add comment 258 Minus [StructLayout(LayoutKind.Sequential)]
Add comment 259 Minus public struct NMHDDISPINFO {
Add comment 260 Minus public NMHDR hdr;
Add comment 261 Minus public int iItem;
Add comment 262 Minus public uint mask;
Add comment 263 Minus public string pszText;
Add comment 264 Minus public int cchTextMax;
Add comment 265 Minus public int iImage;
Add comment 266 Minus public IntPtr lParam;
Add comment 267 Minus }
Add comment 268 Minus */
Add comment 269 250
Add comment 270 Minus public static class CustomDraw {
Add comment 251 Plus public static class CustomDraw
Add comment 252 Plus {
Add comment 271 253 public const int CDRF_DODEFAULT = 0x00000000;
Add comment 272 254 public const int CDRF_NEWFONT = 0x00000002;
Add comment 273 255 public const int CDRF_SKIPDEFAULT = 0x00000004;
Add comment 6 using System.Text;
Add comment 7 using System.Threading.Tasks;
Add comment 8
Add comment 9 Minus namespace BExplorer.Shell.Interop {
Add comment 9 Plus namespace BExplorer.Shell.Interop
Add comment 10 Plus {
Add comment 10 11 /// <summary>
Add comment 11 12 /// Enables extraction of icons for any file type from
Add comment 12 13 /// the Shell.
Add comment 13 14 /// </summary>
Add comment 14 Minus public class FileIcon : IDisposable {
Add comment 15 Plus public class FileIcon : IDisposable
Add comment 16 Plus {
Add comment 15 17
Add comment 16 18 #region UnmanagedCode
Add comment 17 19 /*
Add comment 28 30 //}
Add comment 29 31 */
Add comment 30 32
Add comment 31 Minus public void Dispose() {
Add comment 32 Minus if (ShellIcon != null) {
Add comment 33 Plus public void Dispose()
Add comment 34 Plus {
Add comment 35 Plus if (ShellIcon != null)
Add comment 36 Plus {
Add comment 33 37 ShellIcon.Dispose();
Add comment 34 38 ShellIcon = null;
Add comment 35 39 }
Add comment 77 81
Add comment 78 82 #region Enumerations
Add comment 79 83 [Flags]
Add comment 80 Minus public enum SHGetFileInfoConstants : int {
Add comment 84 Plus public enum SHGetFileInfoConstants : int
Add comment 85 Plus {
Add comment 81 86 SHGFI_ICON = 0x100, // get icon
Add comment 82 87 SHGFI_DISPLAYNAME = 0x200, // get display name
Add comment 83 88 SHGFI_TYPENAME = 0x400, // get type name
Add comment 140 145 /// Gets the information for the specified
Add comment 141 146 /// file name and flags.
Add comment 142 147 /// </summary>
Add comment 143 Minus public void GetInfo() {
Add comment 148 Plus public void GetInfo()
Add comment 149 Plus {
Add comment 144 150 ShellIcon = null;
Add comment 145 151 TypeName = "";
Add comment 146 152 DisplayName = "";
Add comment 149 155 uint shfiSize = (uint)Marshal.SizeOf(shfi.GetType());
Add comment 150 156
Add comment 151 157 int ret = SHGetFileInfo(FileName, 0, ref shfi, shfiSize, (uint)(Flags));
Add comment 152 Minus if (ret != 0) {
Add comment 153 Minus if (shfi.hIcon != IntPtr.Zero) {
Add comment 158 Plus if (ret != 0)
Add comment 159 Plus {
Add comment 160 Plus if (shfi.hIcon != IntPtr.Zero)
Add comment 161 Plus {
Add comment 154 162 ShellIcon = System.Drawing.Icon.FromHandle(shfi.hIcon);
Add comment 155 163 // Now owned by the GDI+ object
Add comment 156 164 //DestroyIcon(shfi.hIcon);
Add comment 158 166 TypeName = shfi.szTypeName;
Add comment 159 167 DisplayName = shfi.szDisplayName;
Add comment 160 168 }
Add comment 161 Minus else {
Add comment 169 Plus else
Add comment 170 Plus {
Add comment 162 171 int err = GetLastError();
Add comment 163 Minus Console.WriteLine("Error {0}", err);
Add comment 172 Plus Console.WriteLine($"Error {err}");
Add comment 164 173 string txtS = new string('\0', 256);
Add comment 165 174 int len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, IntPtr.Zero, err, 0, txtS, 256, 0);
Add comment 166 Minus Console.WriteLine("Len {0} text {1}", len, txtS);
Add comment 175 Plus Console.WriteLine($"Len {len} text {txtS}");
Add comment 167 176 }
Add comment 168 177 }
Add comment 169 178
Add comment 172 181 /// class. Specify the filename and call GetInfo()
Add comment 173 182 /// to retrieve an icon.
Add comment 174 183 /// </summary>
Add comment 175 Minus public FileIcon() {
Add comment 184 Plus public FileIcon()
Add comment 185 Plus {
Add comment 176 186 Flags = SHGetFileInfoConstants.SHGFI_ICON |
Add comment 177 187 SHGetFileInfoConstants.SHGFI_DISPLAYNAME |
Add comment 178 188 SHGetFileInfoConstants.SHGFI_TYPENAME |
Add comment 187 197 /// <param name="fileName">The filename to get the icon,
Add comment 188 198 /// display name and type name for</param>
Add comment 189 199 public FileIcon(string fileName)
Add comment 190 Minus : this() {
Add comment 200 Plus : this()
Add comment 201 Plus {
Add comment 191 202 this.FileName = fileName;
Add comment 192 203 GetInfo();
Add comment 193 204 }
Add comment 200 211 /// for</param>
Add comment 201 212 /// <param name="flags">The flags to use when extracting the
Add comment 202 213 /// icon and other shell information.</param>
Add comment 203 Minus public FileIcon(string fileName, FileIcon.SHGetFileInfoConstants flags) {
Add comment 214 Plus public FileIcon(string fileName, FileIcon.SHGetFileInfoConstants flags)
Add comment 215 Plus {
Add comment 204 216 this.FileName = fileName;
Add comment 205 217 this.Flags = flags;
Add comment 206 218 GetInfo();
FileSystemKnownFolder.cs
/Shell/KnownFolders/FileSystemKnownFolder.cs/Shell/KnownFolders/FileSystemKnownFolder.cs
PreviewPane.xaml.cs
/WpfControlLibrary1/PreviewPane.xaml.cs/WpfControlLibrary1/PreviewPane.xaml.cs