diff --git a/PInvoke/User32/User32_WindowMessage.cs b/PInvoke/User32/User32_WindowMessage.cs index 7e663eb90..391883a32 100644 --- a/PInvoke/User32/User32_WindowMessage.cs +++ b/PInvoke/User32/User32_WindowMessage.cs @@ -12974,7 +12974,7 @@ public struct MDICREATESTRUCT [StructLayout(LayoutKind.Sequential)] public readonly struct MOUSEWHEEL(short distance, MouseButtonState state) { - private readonly ushort btndown = state; + private readonly ushort btndown = (ushort)state; /// /// The distance the wheel is rotated, expressed in multiples or factors of WHEEL_DELTA, which is set to 120. A positive value @@ -12988,8 +12988,7 @@ public readonly struct MOUSEWHEEL(short distance, MouseButtonState state) /// Initializes a new instance of the struct. /// The lParam value from *UISTATE*. - public MOUSEWHEEL(IntPtr lParam) - { btndown = Macros.LOWORD(unchecked((uint)lParam.ToInt32())); distance = unchecked((short)Macros.HIWORD(unchecked((uint)lParam.ToInt32()))); } + public MOUSEWHEEL(IntPtr lParam) : this(unchecked((short)Macros.HIWORD(unchecked((uint)lParam.ToInt32()))), (MouseButtonState)Macros.LOWORD(unchecked((uint)lParam.ToInt32()))) { } /// Performs an implicit conversion from to . /// The wParam.