コード例 #1
0
        public void StartHook()
        {
            if (mouseHookProc == null)
            {
                mouseHookProc = new MouseHookProc(ConfigHook);
            }

            mouseHookHandler = ApiFunctions.SetWindowsHookEx(HookType.WH_MOUSE_LL, mouseHookProc, hInstance, 0);
            logger.Info("Mouse hook started");
        }
コード例 #2
0
 public void StartHook()
 {
     try
     {
         if (keyboardHookDelegate == null)
         {
             keyboardHookDelegate = ConfigHook;
         }
         keyboardHookHandler = ApiFunctions.SetWindowsHookEx(HookType.WH_KEYBOARD_LL, keyboardHookDelegate, hookInstance, 0);
         logger.Info("Keyboard hook started");
     }
     catch (Exception ex)
     {
         logger.Error($"START KEBOARD HOOK ERROR: {ex.StackTrace}");
     }
 }