示例#1
0
        private static int GlobalHookCallback(HookType Type, int code, IntPtr wParam, IntPtr lParam)
        {
            switch (Type)
            {
            case HookType.WH_KEYBOARD_LL:
            {
                if (!KeyboardHandler.Dispatch(code, wParam, lParam))
                {
                    return(1);
                }
                break;
            }

            case HookType.WH_MOUSE_LL:
            {
                if (!MouseHandler.Dispatch(code, wParam, lParam))
                {
                    return(1);
                }
                break;
            }

            default:
                break;
            }

            return(User32.CallNextHookEx(IntPtr.Zero, code, wParam, lParam));
        }