DarkUI.Net5/DarkUI/Win32/DarkControlScrollFilter.cs
Robin baaab81736 Minor refactoring and cleaning
Removed unnecessary comments. Added string interpolation from C# 6.0.
Removed unneeded library references.
2015-11-30 19:19:23 +00:00

27 lines
697 B
C#

using System.Drawing;
using System.Windows.Forms;
namespace DarkUI
{
public class DarkControlScrollFilter : IMessageFilter
{
public bool PreFilterMessage(ref Message m)
{
switch (m.Msg)
{
case (int)WM.MOUSEWHEEL:
case (int)WM.MOUSEHWHEEL:
var 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;
}
}
}