Esempio n. 1
0
        bool IMessageFilter.PreFilterMessage(ref Message m)
        {
            var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));
            var ctl  = Control.FromHandle(hWnd);

            if (hWnd != IntPtr.Zero && hWnd != m.HWnd && ctl != null)
            {
                switch ((WM)m.Msg)
                {
                default:  break;

                case WM.MOUSEWHEEL:
            #if DEBUG
                    DebugTracing.Trace(TraceFlags.ScrollEvents, true, " - {0}.WM.{1}: ", Name,
                                       ((WM)m.Msg));
            #endif
                    if (ctl is HexgridPanel.HexgridPanel || ctl is HexgridExampleForm)
                    {
                        return(NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);
                    }
                    break;
                }
            }
            return(false);
        }
Esempio n. 2
0
        public bool PreFilterMessage(ref Message m)
        {
            if ((WM)m.Msg != WM.MouseHWheel && (WM)m.Msg != WM.MouseWheel)
            {
                return(false);
            }

            var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));
            var ctl  = FromChildHandle(hWnd);

            if (hWnd != IntPtr.Zero && hWnd != m.HWnd && ctl != null)
            {
                switch ((WM)m.Msg)
                {
                case WM.MouseHWheel:
                case WM.MouseWheel:
                    Tracing.ScrollEvents.Trace(true, $" - {Name}.WM.{(WM)m.Msg}: ");
                    return(NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);

                default: break;
                }
            }
            return(false);
        }
        public bool PreFilterMessage(ref Message m)
        {
            if ((WM)m.Msg != WM.MOUSEHWHEEL && (WM)m.Msg != WM.MOUSEWHEEL)
            {
                return(false);
            }

            var hWnd = NativeMethods.WindowFromPoint(WindowsMouseInput.GetPointLParam(m.LParam));
            var ctl  = Control.FromChildHandle(hWnd);

            if (hWnd != IntPtr.Zero && hWnd != m.HWnd && ctl != null)
            {
                switch ((WM)m.Msg)
                {
                case WM.MOUSEHWHEEL:
                case WM.MOUSEWHEEL:
                    DebugTracing.Trace(TraceFlags.ScrollEvents, true, " - {0}.WM.{1}: ", Name, ((WM)m.Msg));
                    return(NativeMethods.SendMessage(hWnd, m.Msg, m.WParam, m.LParam) == IntPtr.Zero);

                default: break;
                }
            }
            return(false);
        }