protected override void OnStart()
        {
            msgID_KeyboardLL = NativeMethods.RegisterWindowMessage("SMART_SYSTEM_MENU_HOOK_KEYBOARDLL");
            msgID_KeyboardLL_HookReplaced = NativeMethods.RegisterWindowMessage("SMART_SYSTEM_MENU_HOOK_KEYBOARDLL_REPLACED");

            if (Environment.OSVersion.Version.Major >= 6)
            {
                NativeMethods.ChangeWindowMessageFilter(msgID_KeyboardLL, NativeConstants.MSGFLT_ADD);
                NativeMethods.ChangeWindowMessageFilter(msgID_KeyboardLL_HookReplaced, NativeConstants.MSGFLT_ADD);
            }
            NativeHookMethods.InitializeKeyboardLLHook(0, handle);
        }
Beispiel #2
0
        protected override void OnStart()
        {
            _msgIdKeyboardLL             = RegisterWindowMessage("SMART_SYSTEM_MENU_HOOK_KEYBOARDLL");
            _msgIdKeyboardLLHookReplaced = RegisterWindowMessage("SMART_SYSTEM_MENU_HOOK_KEYBOARDLL_REPLACED");

            if (Environment.OSVersion.Version.Major >= 6)
            {
                ChangeWindowMessageFilter(_msgIdKeyboardLL, Constants.MSGFLT_ADD);
                ChangeWindowMessageFilter(_msgIdKeyboardLLHookReplaced, Constants.MSGFLT_ADD);
            }
            NativeHookMethods.InitializeKeyboardLLHook(0, _handle, _dragByMouseMenuItem);
        }