Esempio n. 1
0
 public void HookKeyboard()
 {
     _HookProc = new WinAPI.HookProcDelegate(KeyboardHookProc);
     _HookHandle = WinAPI.SetWindowsHookEx(WinAPI.WH_KEYBOARD_LL, _HookProc, IntPtr.Zero, 0);
     if (_HookHandle != 0)
     {
         Debug.WriteLine("Keyboard hooked");
     }
 }
Esempio n. 2
0
 public void HookMouse()
 {
     _HookProc = new WinAPI.HookProcDelegate(MouseHookProc);
     _HookHandle = WinAPI.SetWindowsHookEx(WinAPI.WH_MOUSE_LL, _HookProc, IntPtr.Zero, 0);
     if (_HookHandle != 0)
     {
         Debug.WriteLine("Mouse hooked");
     }
 }