Пример #1
0
        bool IMessageFilter.PreFilterMessage(ref Message m)
        {
            if (m.Msg == WM_MOUSEWHEEL)
            {
                var left = (int)m.LParam & 0xFFFF;
                var top  = ((int)m.LParam >> 16) & 0xFFFF;

                var controlHandle = WindowFromPoint(new POINT(left, top));

                var args = new WheelInterceptedEventArgs(controlHandle, m.HWnd);

                if (WheelIntercepted != null)
                {
                    WheelIntercepted(this, args);
                }

                if (args.DestinationHandle != IntPtr.Zero)
                {
                    SendMessage(args.DestinationHandle, m.Msg, m.WParam, m.LParam);
                    return(true);
                }
            }

            return(false);
        }
        bool IMessageFilter.PreFilterMessage(ref Message m)
        {
            if (m.Msg == WM_MOUSEWHEEL)
            {
                var left = (int)m.LParam & 0xFFFF;
                var top = ((int)m.LParam >> 16) & 0xFFFF;

                var controlHandle = WindowFromPoint(new POINT(left, top));

                var args = new WheelInterceptedEventArgs(controlHandle, m.HWnd);

                if (WheelIntercepted != null)
                    WheelIntercepted(this, args);

                if (args.DestinationHandle != IntPtr.Zero)
                {
                    SendMessage(args.DestinationHandle, m.Msg, m.WParam, m.LParam);
                    return true;
                }
            }

            return false;
        }