From 275016379ae0975aaa6efb29fabb09702a68391f Mon Sep 17 00:00:00 2001 From: David Hall Date: Mon, 1 May 2023 09:56:04 -0600 Subject: [PATCH] Fixed bug with SetWindowSubclass, SUBCLASSPROC, and RemoveWindowSubclass (#393) --- PInvoke/ComCtl32/CommCtrl.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PInvoke/ComCtl32/CommCtrl.cs b/PInvoke/ComCtl32/CommCtrl.cs index 7a5af9bc0..92e4a9d1c 100644 --- a/PInvoke/ComCtl32/CommCtrl.cs +++ b/PInvoke/ComCtl32/CommCtrl.cs @@ -71,7 +71,7 @@ public static partial class ComCtl32 // dwRefData); https://msdn.microsoft.com/en-us/library/windows/desktop/bb776774(v=vs.85).aspx [PInvokeData("Commctrl.h", MSDNShortId = "bb776774")] [UnmanagedFunctionPointer(CallingConvention.Winapi)] - public delegate IntPtr SUBCLASSPROC(HWND hWnd, uint uMsg, IntPtr wParam, IntPtr lParam, [MarshalAs(UnmanagedType.SysUInt)] uint uIdSubclass, IntPtr dwRefData); + public delegate IntPtr SUBCLASSPROC(HWND hWnd, uint uMsg, IntPtr wParam, IntPtr lParam, nuint uIdSubclass, IntPtr dwRefData); /// /// The set of bit flags that indicate which common control classes will be loaded from the DLL when calling . @@ -1267,7 +1267,7 @@ public static RECT GetEffectiveClientRect(HWND hWnd, int[] controlIdentifiers) [DllImport(Lib.ComCtl32, SetLastError = false, ExactSpelling = true)] [PInvokeData("Commctrl.h", MSDNShortId = "bb762094")] [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, [MarshalAs(UnmanagedType.SysUInt)] uint uIdSubclass); + public static extern bool RemoveWindowSubclass([In] HWND hWnd, [In, MarshalAs(UnmanagedType.FunctionPtr)] SUBCLASSPROC pfnSubclass, nuint uIdSubclass); /// Installs or updates a window subclass callback. /// @@ -1305,7 +1305,7 @@ public static RECT GetEffectiveClientRect(HWND hWnd, int[] controlIdentifiers) [DllImport(Lib.ComCtl32, SetLastError = false, ExactSpelling = true)] [PInvokeData("Commctrl.h", MSDNShortId = "bb762102")] [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, [MarshalAs(UnmanagedType.SysUInt)] uint uIdSubclass, IntPtr dwRefData); + public static extern bool SetWindowSubclass([In] HWND hWnd, [In, MarshalAs(UnmanagedType.FunctionPtr)] SUBCLASSPROC pfnSubclass, nuint uIdSubclass, IntPtr dwRefData); /// ///