public HookKeys() { _kProc = HookKeyboardCb; _mProc = HookMouseCb; _thread = new SprayThread(); }
/// <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; }
public Hook() { this.proc = new NativeMethods.LowLevelProc(LowLevelProc); }