private IntPtr HookProcedure(int nCode, IntPtr wParam, IntPtr lParam)
        {
            if (nCode == 0)
            {
                OnHookCalled?.Invoke(wParam, lParam);
            }

            return(User32.CallNextHookEx(hookHandle, nCode, wParam, lParam));
        }
Example #2
0
        private IntPtr HookProcedure(int nCode, IntPtr wParam, IntPtr lParam)
        {
            if (nCode == 0)
            {
                if (WindowsHookFilter.InternalFilterEventsHelper(wParam, lParam))
                {
                    return((IntPtr)(-1));
                }
                else
                {
                    OnHookCalled?.Invoke(wParam, lParam);
                }
            }

            return(User32.CallNextHookEx(_hookHandler, nCode, wParam, lParam));
        }