示例#1
0
        protected void InputTask()
        {
            Input.HandlerEnabled = false;
            try
            {
                mouseHook    = Win32Util.SetWindowsHookEx(Win32Util.HookType.WH_MOUSE_LL, OnMouseInput, IntPtr.Zero, 0);
                keyboardHook = Win32Util.SetWindowsHookEx(Win32Util.HookType.WH_KEYBOARD_LL, OnKeyboardInput, IntPtr.Zero, 0);

                Logger.Log("Input task started");

                Input.HandlerEnabled = true;

                Application.Run();
            }
            catch (ThreadAbortException)
            {
                Thread.ResetAbort();
                OnInputQuit();

                Logger.Log("Input task finished");
            }
        }