Exemple #1
0
 private IntPtr SetHook(GlobalKeyboardHookProc proc)
 {
     using (Process curProcess = Process.GetCurrentProcess())
         using (ProcessModule curModule = curProcess.MainModule)
         {
             return(SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0));
         }
 }
Exemple #2
0
 public GlobalKeyboardHook()
 {
     _proc = HookCallback;
 }
Exemple #3
0
 private static extern IntPtr SetWindowsHookEx(int idHook, GlobalKeyboardHookProc lpfn, IntPtr hMod, uint dwThreadId);