diff --git a/QuickLook.Plugin/QuickLook.Plugin.AppViewer/MsiInfoPanel.xaml b/QuickLook.Plugin/QuickLook.Plugin.AppViewer/MsiInfoPanel.xaml index c046ec3..a330d41 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.AppViewer/MsiInfoPanel.xaml +++ b/QuickLook.Plugin/QuickLook.Plugin.AppViewer/MsiInfoPanel.xaml @@ -8,13 +8,6 @@ FontSize="14" UseLayoutRounding="True" mc:Ignorable="d"> - - - - - - - diff --git a/QuickLook.Plugin/QuickLook.Plugin.AppViewer/MsiInfoPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.AppViewer/MsiInfoPanel.xaml.cs index dd8ebfa..30dd0f4 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.AppViewer/MsiInfoPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.AppViewer/MsiInfoPanel.xaml.cs @@ -35,9 +35,6 @@ public partial class MsiInfoPanel : UserControl, IAppInfoPanel { InitializeComponent(); - // apply global theme - Resources.MergedDictionaries[0].Clear(); - string translationFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Translations.config"); productNameTitle.Text = TranslationHelper.Get("PRODUCT_NAME", translationFile); productVersionTitle.Text = TranslationHelper.Get("PRODUCT_VERSION", translationFile); diff --git a/QuickLook.Plugin/QuickLook.Plugin.AppViewer/WindowsThumbnailProvider.cs b/QuickLook.Plugin/QuickLook.Plugin.AppViewer/WindowsThumbnailProvider.cs index 449524f..e2090a0 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.AppViewer/WindowsThumbnailProvider.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.AppViewer/WindowsThumbnailProvider.cs @@ -44,13 +44,13 @@ internal static class WindowsThumbnailProvider private static extern int SHCreateItemFromParsingName( [MarshalAs(UnmanagedType.LPWStr)] string path, // The following parameter is not used - binding context. - IntPtr pbc, + nint pbc, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem shellItem); [DllImport("gdi32.dll")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool DeleteObject(IntPtr hObject); + private static extern bool DeleteObject(nint hObject); public static Bitmap GetThumbnail(string fileName, int width, int height, ThumbnailOptions options) { @@ -71,7 +71,7 @@ internal static class WindowsThumbnailProvider } } - internal static Bitmap GetBitmapFromHBitmap(IntPtr nativeHBitmap) + internal static Bitmap GetBitmapFromHBitmap(nint nativeHBitmap) { var bmp = Image.FromHbitmap(nativeHBitmap); @@ -115,7 +115,7 @@ internal static class WindowsThumbnailProvider return srcBitmap; } - private static IntPtr GetHBitmap(string fileName, int width, int height, ThumbnailOptions options) + private static nint GetHBitmap(string fileName, int width, int height, ThumbnailOptions options) { var shellItem2Guid = new Guid(IShellItem2Guid); var retCode = @@ -142,18 +142,18 @@ internal static class WindowsThumbnailProvider [Guid("43826d1e-e718-42ee-bc55-a1e261c37bfe")] internal interface IShellItem { - void BindToHandler(IntPtr pbc, - [MarshalAs(UnmanagedType.LPStruct)] Guid bhid, - [MarshalAs(UnmanagedType.LPStruct)] Guid riid, - out IntPtr ppv); + public void BindToHandler(nint pbc, + [MarshalAs(UnmanagedType.LPStruct)] Guid bhid, + [MarshalAs(UnmanagedType.LPStruct)] Guid riid, + out nint ppv); - void GetParent(out IShellItem ppsi); + public void GetParent(out IShellItem ppsi); - void GetDisplayName(SIGDN sigdnName, out IntPtr ppszName); + public void GetDisplayName(SIGDN sigdnName, out nint ppszName); - void GetAttributes(uint sfgaoMask, out uint psfgaoAttribs); + public void GetAttributes(uint sfgaoMask, out uint psfgaoAttribs); - void Compare(IShellItem psi, uint hint, out int piOrder); + public void Compare(IShellItem psi, uint hint, out int piOrder); } internal enum SIGDN : uint @@ -165,7 +165,7 @@ internal static class WindowsThumbnailProvider PARENTRELATIVEEDITING = 0x80031001, DESKTOPABSOLUTEEDITING = 0x8004c000, FILESYSPATH = 0x80058000, - URL = 0x80068000 + URL = 0x80068000, } internal enum HResult @@ -182,7 +182,7 @@ internal static class WindowsThumbnailProvider Win32ErrorCanceled = 1223, Canceled = unchecked((int)0x800704C7), ResourceInUse = unchecked((int)0x800700AA), - AccessDenied = unchecked((int)0x80030005) + AccessDenied = unchecked((int)0x80030005), } [ComImport] @@ -191,10 +191,10 @@ internal static class WindowsThumbnailProvider internal interface IShellItemImageFactory { [PreserveSig] - HResult GetImage( + public HResult GetImage( [In][MarshalAs(UnmanagedType.Struct)] NativeSize size, [In] ThumbnailOptions flags, - [Out] out IntPtr phbm); + [Out] out nint phbm); } [StructLayout(LayoutKind.Sequential)] diff --git a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFileListView.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFileListView.xaml.cs index 304ab67..d664f8f 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFileListView.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFileListView.xaml.cs @@ -20,9 +20,6 @@ using System.Windows.Controls; namespace QuickLook.Plugin.ArchiveViewer; -/// -/// Interaction logic for ArchiveFileListView.xaml -/// public partial class ArchiveFileListView : UserControl, IDisposable { public ArchiveFileListView() diff --git a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveInfoPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveInfoPanel.xaml.cs index 8f1d40c..472d00f 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveInfoPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveInfoPanel.xaml.cs @@ -32,9 +32,6 @@ using System.Windows.Controls; namespace QuickLook.Plugin.ArchiveViewer; -/// -/// Interaction logic for ArchiveInfoPanel.xaml -/// public partial class ArchiveInfoPanel : UserControl, IDisposable, INotifyPropertyChanged { private readonly Dictionary _fileEntries = []; diff --git a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/IconManager.cs b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/IconManager.cs index aedac36..3a2edcf 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/IconManager.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/IconManager.cs @@ -196,7 +196,7 @@ public static class IconManager public const uint FileAttributeDirectory = 0x00000010; [DllImport("Shell32.dll")] - public static extern IntPtr SHGetFileInfo( + public static extern nint SHGetFileInfo( string pszPath, uint dwFileAttributes, ref Shfileinfo psfi, @@ -208,7 +208,7 @@ public static class IconManager public struct Shfileinfo { private const int Namesize = 80; - public readonly IntPtr hIcon; + public readonly nint hIcon; private readonly int iIcon; private readonly uint dwAttributes; @@ -232,6 +232,6 @@ public static class IconManager /// Pointer to icon handle. /// N/A [DllImport("User32.dll")] - public static extern int DestroyIcon(IntPtr hIcon); + public static extern int DestroyIcon(nint hIcon); } } diff --git a/QuickLook.Plugin/QuickLook.Plugin.CsvViewer/CsvViewerPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.CsvViewer/CsvViewerPanel.xaml.cs index a322fc0..c6d1daa 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.CsvViewer/CsvViewerPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.CsvViewer/CsvViewerPanel.xaml.cs @@ -31,9 +31,6 @@ using UtfUnknown; namespace QuickLook.Plugin.CsvViewer; -/// -/// Interaction logic for CsvViewerPanel.xaml -/// public partial class CsvViewerPanel : UserControl { public CsvViewerPanel() diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs index 5b54d21..d5dc383 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/ImagePanel.xaml.cs @@ -38,9 +38,6 @@ using System.Windows.Threading; namespace QuickLook.Plugin.ImageViewer; -/// -/// Interaction logic for ImagePanel.xaml -/// public partial class ImagePanel : UserControl, INotifyPropertyChanged, IDisposable { private Visibility _backgroundVisibility = Visibility.Visible; diff --git a/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/PdfViewerControl.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/PdfViewerControl.xaml.cs index 27aa4b1..8119117 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/PdfViewerControl.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/PdfViewerControl.xaml.cs @@ -29,9 +29,6 @@ using System.Windows.Controls; namespace QuickLook.Plugin.PDFViewer; -/// -/// Interaction logic for PdfViewer.xaml -/// public partial class PdfViewerControl : UserControl, INotifyPropertyChanged, IDisposable { private int _changePageDeltaSum; diff --git a/QuickLook.Plugin/QuickLook.Plugin.PEViewer/PEInfoPanel.xaml b/QuickLook.Plugin/QuickLook.Plugin.PEViewer/PEInfoPanel.xaml index a6c4aed..c6fd08f 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.PEViewer/PEInfoPanel.xaml +++ b/QuickLook.Plugin/QuickLook.Plugin.PEViewer/PEInfoPanel.xaml @@ -8,13 +8,6 @@ FontSize="14" UseLayoutRounding="True" mc:Ignorable="d"> - - - - - - - diff --git a/QuickLook.Plugin/QuickLook.Plugin.PEViewer/PEInfoPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.PEViewer/PEInfoPanel.xaml.cs index 87cfa9b..3e7f7d7 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.PEViewer/PEInfoPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.PEViewer/PEInfoPanel.xaml.cs @@ -29,27 +29,16 @@ namespace QuickLook.Plugin.PEViewer; public partial class PEInfoPanel : UserControl { - private bool _stop; - public PEInfoPanel() { InitializeComponent(); - // apply global theme - Resources.MergedDictionaries[0].Clear(); - string translationFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Translations.config"); totalSizeTitle.Text = TranslationHelper.Get("TOTAL_SIZE", translationFile); fileVersionTitle.Text = TranslationHelper.Get("FILE_VERSION", translationFile); productVersionTitle.Text = TranslationHelper.Get("PRODUCT_VERSION", translationFile); } - public bool Stop - { - set => _stop = value; - get => _stop; - } - public void DisplayInfo(string path) { _ = Task.Run(() => @@ -71,8 +60,6 @@ public partial class PEInfoPanel : UserControl var name = Path.GetFileName(path); filename.Text = string.IsNullOrEmpty(name) ? path : name; - Stop = false; - _ = Task.Run(() => { if (File.Exists(path)) diff --git a/QuickLook.Plugin/QuickLook.Plugin.PEViewer/WindowsThumbnailProvider.cs b/QuickLook.Plugin/QuickLook.Plugin.PEViewer/WindowsThumbnailProvider.cs index 971de88..d14a813 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.PEViewer/WindowsThumbnailProvider.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.PEViewer/WindowsThumbnailProvider.cs @@ -44,7 +44,7 @@ internal static class WindowsThumbnailProvider private static extern int SHCreateItemFromParsingName( [MarshalAs(UnmanagedType.LPWStr)] string path, // The following parameter is not used - binding context. - IntPtr pbc, + nint pbc, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem shellItem); @@ -71,7 +71,7 @@ internal static class WindowsThumbnailProvider } } - internal static Bitmap GetBitmapFromHBitmap(IntPtr nativeHBitmap) + internal static Bitmap GetBitmapFromHBitmap(nint nativeHBitmap) { var bmp = Image.FromHbitmap(nativeHBitmap); @@ -115,7 +115,7 @@ internal static class WindowsThumbnailProvider return srcBitmap; } - private static IntPtr GetHBitmap(string fileName, int width, int height, ThumbnailOptions options) + private static nint GetHBitmap(string fileName, int width, int height, ThumbnailOptions options) { var shellItem2Guid = new Guid(IShellItem2Guid); var retCode = @@ -142,18 +142,18 @@ internal static class WindowsThumbnailProvider [Guid("43826d1e-e718-42ee-bc55-a1e261c37bfe")] internal interface IShellItem { - void BindToHandler(IntPtr pbc, - [MarshalAs(UnmanagedType.LPStruct)] Guid bhid, - [MarshalAs(UnmanagedType.LPStruct)] Guid riid, - out IntPtr ppv); + public void BindToHandler(nint pbc, + [MarshalAs(UnmanagedType.LPStruct)] Guid bhid, + [MarshalAs(UnmanagedType.LPStruct)] Guid riid, + out nint ppv); - void GetParent(out IShellItem ppsi); + public void GetParent(out IShellItem ppsi); - void GetDisplayName(SIGDN sigdnName, out IntPtr ppszName); + public void GetDisplayName(SIGDN sigdnName, out nint ppszName); - void GetAttributes(uint sfgaoMask, out uint psfgaoAttribs); + public void GetAttributes(uint sfgaoMask, out uint psfgaoAttribs); - void Compare(IShellItem psi, uint hint, out int piOrder); + public void Compare(IShellItem psi, uint hint, out int piOrder); } internal enum SIGDN : uint @@ -165,7 +165,7 @@ internal static class WindowsThumbnailProvider PARENTRELATIVEEDITING = 0x80031001, DESKTOPABSOLUTEEDITING = 0x8004c000, FILESYSPATH = 0x80058000, - URL = 0x80068000 + URL = 0x80068000, } internal enum HResult @@ -182,7 +182,7 @@ internal static class WindowsThumbnailProvider Win32ErrorCanceled = 1223, Canceled = unchecked((int)0x800704C7), ResourceInUse = unchecked((int)0x800700AA), - AccessDenied = unchecked((int)0x80030005) + AccessDenied = unchecked((int)0x80030005), } [ComImport] @@ -191,10 +191,10 @@ internal static class WindowsThumbnailProvider internal interface IShellItemImageFactory { [PreserveSig] - HResult GetImage( + public HResult GetImage( [In][MarshalAs(UnmanagedType.Struct)] NativeSize size, [In] ThumbnailOptions flags, - [Out] out IntPtr phbm); + [Out] out nint phbm); } [StructLayout(LayoutKind.Sequential)] diff --git a/QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/PluginInfoPanel.xaml b/QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/PluginInfoPanel.xaml index 58816fa..4792ab8 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/PluginInfoPanel.xaml +++ b/QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/PluginInfoPanel.xaml @@ -7,13 +7,6 @@ Height="200" FontSize="14" mc:Ignorable="d"> - - - - - - - diff --git a/QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/PluginInfoPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/PluginInfoPanel.xaml.cs index 5653b5d..3318a34 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/PluginInfoPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/PluginInfoPanel.xaml.cs @@ -37,9 +37,6 @@ public partial class PluginInfoPanel : UserControl { InitializeComponent(); - // apply global theme - Resources.MergedDictionaries[0].Clear(); - _path = path; _context = context; ReadInfo(); diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs index d224b93..a64cabb 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs @@ -45,9 +45,6 @@ using WPFMediaKit.DirectShow.MediaPlayers; namespace QuickLook.Plugin.VideoViewer; -/// -/// Interaction logic for UserControl1.xaml -/// public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChanged { private readonly ContextObject _context; diff --git a/QuickLook/Controls/GlassLayer/GlassLayer.xaml.cs b/QuickLook/Controls/GlassLayer/GlassLayer.xaml.cs index a024984..fa4e2a4 100644 --- a/QuickLook/Controls/GlassLayer/GlassLayer.xaml.cs +++ b/QuickLook/Controls/GlassLayer/GlassLayer.xaml.cs @@ -23,9 +23,6 @@ using QuickLook.Common.Helpers; namespace QuickLook.Controls.GlassLayer; -/// -/// Interaction logic for GlassLayer.xaml -/// public partial class GlassLayer : UserControl { public GlassLayer() diff --git a/QuickLook/Helpers/ShareHelper.cs b/QuickLook/Helpers/ShareHelper.cs index 2de2f6d..447e5f2 100644 --- a/QuickLook/Helpers/ShareHelper.cs +++ b/QuickLook/Helpers/ShareHelper.cs @@ -109,12 +109,12 @@ internal static class DataTransferManagerHelper private static IDataTransferManagerInterop DataTransferManagerInterop => (IDataTransferManagerInterop)WindowsRuntimeMarshal.GetActivationFactory(typeof(DataTransferManager)); - public static DataTransferManager GetForWindow(IntPtr hwnd) + public static DataTransferManager GetForWindow(nint hwnd) { return DataTransferManagerInterop.GetForWindow(hwnd, DTM_IID); } - public static void ShowShareUIForWindow(IntPtr hwnd) + public static void ShowShareUIForWindow(nint hwnd) { DataTransferManagerInterop.ShowShareUIForWindow(hwnd); } @@ -124,8 +124,8 @@ internal static class DataTransferManagerHelper [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] private interface IDataTransferManagerInterop { - DataTransferManager GetForWindow([In] IntPtr appWindow, [In] ref Guid riid); + public DataTransferManager GetForWindow([In] nint appWindow, [In] ref Guid riid); - void ShowShareUIForWindow(IntPtr appWindow); + public void ShowShareUIForWindow(nint appWindow); } } diff --git a/QuickLook/NativeMethods/ShellLink.cs b/QuickLook/NativeMethods/ShellLink.cs index 8269a90..898ce1d 100644 --- a/QuickLook/NativeMethods/ShellLink.cs +++ b/QuickLook/NativeMethods/ShellLink.cs @@ -110,64 +110,64 @@ internal enum SLR_FLAGS internal interface IShellLinkW { /// Retrieves the path and file name of a Shell link object - void GetPath([Out] [MarshalAs(UnmanagedType.LPWStr)] + public void GetPath([Out] [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxPath, out WIN32_FIND_DATAW pfd, SLGP_FLAGS fFlags); /// Retrieves the list of item identifiers for a Shell link object - void GetIDList(out IntPtr ppidl); + public void GetIDList(out nint ppidl); /// Sets the pointer to an item identifier list (PIDL) for a Shell link object. - void SetIDList(IntPtr pidl); + public void SetIDList(nint pidl); /// Retrieves the description string for a Shell link object - void GetDescription([Out] [MarshalAs(UnmanagedType.LPWStr)] + public void GetDescription([Out] [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszName, int cchMaxName); /// Sets the description for a Shell link object. The description can be any application-defined string - void SetDescription([MarshalAs(UnmanagedType.LPWStr)] string pszName); + public void SetDescription([MarshalAs(UnmanagedType.LPWStr)] string pszName); /// Retrieves the name of the working directory for a Shell link object - void GetWorkingDirectory([Out] [MarshalAs(UnmanagedType.LPWStr)] + public void GetWorkingDirectory([Out] [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir, int cchMaxPath); /// Sets the name of the working directory for a Shell link object - void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir); + public void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir); /// Retrieves the command-line arguments associated with a Shell link object - void GetArguments([Out] [MarshalAs(UnmanagedType.LPWStr)] + public void GetArguments([Out] [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs, int cchMaxPath); /// Sets the command-line arguments for a Shell link object - void SetArguments([MarshalAs(UnmanagedType.LPWStr)] string pszArgs); + public void SetArguments([MarshalAs(UnmanagedType.LPWStr)] string pszArgs); /// Retrieves the hot key for a Shell link object - void GetHotkey(out short pwHotkey); + public void GetHotkey(out short pwHotkey); /// Sets a hot key for a Shell link object - void SetHotkey(short wHotkey); + public void SetHotkey(short wHotkey); /// Retrieves the show command for a Shell link object - void GetShowCmd(out int piShowCmd); + public void GetShowCmd(out int piShowCmd); /// Sets the show command for a Shell link object. The show command sets the initial show state of the window. - void SetShowCmd(int iShowCmd); + public void SetShowCmd(int iShowCmd); /// Retrieves the location (path and index) of the icon for a Shell link object - void GetIconLocation([Out] [MarshalAs(UnmanagedType.LPWStr)] + public void GetIconLocation([Out] [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszIconPath, int cchIconPath, out int piIcon); /// Sets the location (path and index) of the icon for a Shell link object - void SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon); + public void SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon); /// Sets the relative path to the Shell link object - void SetRelativePath([MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, int dwReserved); + public void SetRelativePath([MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, int dwReserved); /// Attempts to find the target of a Shell link, even if it has been moved or renamed - void Resolve(IntPtr hwnd, SLR_FLAGS fFlags); + public void Resolve(nint hwnd, SLR_FLAGS fFlags); /// Sets the path and file name of a Shell link object - void SetPath([MarshalAs(UnmanagedType.LPWStr)] string pszFile); + public void SetPath([MarshalAs(UnmanagedType.LPWStr)] string pszFile); } // CLSID_ShellLink from ShlGuid.h diff --git a/QuickLook/Plugin/InfoPanel/InfoPanel.xaml b/QuickLook/Plugin/InfoPanel/InfoPanel.xaml index c79f08b..3150f98 100644 --- a/QuickLook/Plugin/InfoPanel/InfoPanel.xaml +++ b/QuickLook/Plugin/InfoPanel/InfoPanel.xaml @@ -9,13 +9,6 @@ FontSize="14" UseLayoutRounding="True" mc:Ignorable="d"> - - - - - - - diff --git a/QuickLook/Plugin/InfoPanel/InfoPanel.xaml.cs b/QuickLook/Plugin/InfoPanel/InfoPanel.xaml.cs index 043ab01..d489893 100644 --- a/QuickLook/Plugin/InfoPanel/InfoPanel.xaml.cs +++ b/QuickLook/Plugin/InfoPanel/InfoPanel.xaml.cs @@ -25,9 +25,6 @@ using System.Windows.Controls; namespace QuickLook.Plugin.InfoPanel; -/// -/// Interaction logic for InfoPanel.xaml -/// public partial class InfoPanel : UserControl { private bool _stop; @@ -35,9 +32,6 @@ public partial class InfoPanel : UserControl public InfoPanel() { InitializeComponent(); - - // apply global theme - Resources.MergedDictionaries[0].Clear(); } public bool Stop @@ -48,7 +42,7 @@ public partial class InfoPanel : UserControl public void DisplayInfo(string path) { - Task.Run(() => + _ = Task.Run(() => { var scale = DisplayDeviceHelper.GetCurrentScaleFactor(); diff --git a/QuickLook/Plugin/InfoPanel/WindowsThumbnailProvider.cs b/QuickLook/Plugin/InfoPanel/WindowsThumbnailProvider.cs index c8adf44..a834750 100644 --- a/QuickLook/Plugin/InfoPanel/WindowsThumbnailProvider.cs +++ b/QuickLook/Plugin/InfoPanel/WindowsThumbnailProvider.cs @@ -44,13 +44,13 @@ internal static class WindowsThumbnailProvider private static extern int SHCreateItemFromParsingName( [MarshalAs(UnmanagedType.LPWStr)] string path, // The following parameter is not used - binding context. - IntPtr pbc, + nint pbc, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem shellItem); [DllImport("gdi32.dll")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool DeleteObject(IntPtr hObject); + private static extern bool DeleteObject(nint hObject); public static Bitmap GetThumbnail(string fileName, int width, int height, ThumbnailOptions options) { @@ -71,7 +71,7 @@ internal static class WindowsThumbnailProvider } } - internal static Bitmap GetBitmapFromHBitmap(IntPtr nativeHBitmap) + internal static Bitmap GetBitmapFromHBitmap(nint nativeHBitmap) { var bmp = Image.FromHbitmap(nativeHBitmap); @@ -115,7 +115,7 @@ internal static class WindowsThumbnailProvider return srcBitmap; } - private static IntPtr GetHBitmap(string fileName, int width, int height, ThumbnailOptions options) + private static nint GetHBitmap(string fileName, int width, int height, ThumbnailOptions options) { var shellItem2Guid = new Guid(IShellItem2Guid); var retCode = @@ -142,18 +142,18 @@ internal static class WindowsThumbnailProvider [Guid("43826d1e-e718-42ee-bc55-a1e261c37bfe")] internal interface IShellItem { - void BindToHandler(IntPtr pbc, + public void BindToHandler(nint pbc, [MarshalAs(UnmanagedType.LPStruct)] Guid bhid, [MarshalAs(UnmanagedType.LPStruct)] Guid riid, - out IntPtr ppv); + out nint ppv); - void GetParent(out IShellItem ppsi); + public void GetParent(out IShellItem ppsi); - void GetDisplayName(SIGDN sigdnName, out IntPtr ppszName); + public void GetDisplayName(SIGDN sigdnName, out nint ppszName); - void GetAttributes(uint sfgaoMask, out uint psfgaoAttribs); + public void GetAttributes(uint sfgaoMask, out uint psfgaoAttribs); - void Compare(IShellItem psi, uint hint, out int piOrder); + public void Compare(IShellItem psi, uint hint, out int piOrder); } internal enum SIGDN : uint @@ -194,7 +194,7 @@ internal static class WindowsThumbnailProvider HResult GetImage( [In][MarshalAs(UnmanagedType.Struct)] NativeSize size, [In] ThumbnailOptions flags, - [Out] out IntPtr phbm); + [Out] out nint phbm); } [StructLayout(LayoutKind.Sequential)] diff --git a/QuickLook/ViewerWindow.xaml.cs b/QuickLook/ViewerWindow.xaml.cs index 05610f5..802e78b 100644 --- a/QuickLook/ViewerWindow.xaml.cs +++ b/QuickLook/ViewerWindow.xaml.cs @@ -31,9 +31,6 @@ using Size = System.Windows.Size; namespace QuickLook; -/// -/// Interaction logic for ViewerWindow.xaml -/// public partial class ViewerWindow : Window { private Size _customWindowSize = Size.Empty;