tx
2025-04-14 c33f54888d8fb4e1961bca69fe3d01e87fc54be6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#region Imports
 
using DPumpHydr.WinFrmUI.RLT.Enum.Crown;
using System.Drawing;
using System.Windows.Forms;
 
#endregion
 
namespace DPumpHydr.WinFrmUI.RLT.Native
{
    #region ControlScrollFilterNative
 
    public class ControlScrollFilter : IMessageFilter
    {
        public bool PreFilterMessage(ref Message m)
        {
            switch (m.Msg)
            {
                case (int)WM.MOUSEWHEEL:
                case (int)WM.MOUSEHWHEEL:
                    System.IntPtr hControlUnderMouse = Native.WindowFromPoint(new Point((int)m.LParam));
 
                    if (hControlUnderMouse == m.HWnd)
                    {
                        return false;
                    }
 
                    Native.SendMessage(hControlUnderMouse, (uint)m.Msg, m.WParam, m.LParam);
                    return true;
            }
 
            return false;
        }
    }
 
    #endregion
}