Пример #1
0
        public HookKeys()
        {
            _kProc = HookKeyboardCb;
            _mProc = HookMouseCb;

            _thread = new SprayThread();
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="KeyboardListenerService"/> class.
        /// </summary>
        public KeyboardListenerService()
        {
            // We have to store the HookCallback so that it is not garbage collected
            this.hookedLowLevelKeyboardProc = this.LowLevelKeyboardProc;

            // Set the hook
            this.hookIdKeyboard = NativeMethods.SetKeyboardHook(this.hookedLowLevelKeyboardProc);

            // Assign the asynchronous callback event
            this.hookedKeyboardCallbackAsync = this.KeyboardListener_KeyboardCallbackAsync;
        }
Пример #3
0
 public Hook()
 {
     this.proc = new NativeMethods.LowLevelProc(LowLevelProc);
 }