Exemplo n.º 1
0
 private static IntPtr SetHook(NativeMethods.LowLevelHoocProc proc)
 {
     using (Process curProcess = Process.GetCurrentProcess())
         using (ProcessModule curModule = curProcess.MainModule)
         {
             return(NativeMethods.SetWindowsHookEx(WH_KEYBOARD_LL, proc, NativeMethods.GetModuleHandle(curModule.ModuleName), 0));
         }
 }
Exemplo n.º 2
0
 public KeyboardHook()
 {
     _proc = HookCallback;
 }
Exemplo n.º 3
0
 public MouseHook(bool watchForMouseButtonOnly = false)
 {
     this.watchForMouseButtonOnly = watchForMouseButtonOnly;
     _proc = HookCallback;
 }