Skip to content

Commit

Permalink
Fixed bug in MOUSEWHEEL
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hall committed Jan 29, 2025
1 parent 3c7e51a commit 3d13aa2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions PInvoke/User32/User32_WindowMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/// <summary>
/// The distance the wheel is rotated, expressed in multiples or factors of WHEEL_DELTA, which is set to 120. A positive value
Expand All @@ -12988,8 +12988,7 @@ public readonly struct MOUSEWHEEL(short distance, MouseButtonState state)

/// <summary>Initializes a new instance of the <see cref="MOUSEWHEEL"/> struct.</summary>
/// <param name="lParam">The lParam value from *UISTATE*.</param>
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()))) { }

/// <summary>Performs an implicit conversion from <see cref="IntPtr"/> to <see cref="MOUSEWHEEL"/>.</summary>
/// <param name="p">The wParam.</param>
Expand Down

0 comments on commit 3d13aa2

Please sign in to comment.