Esempio n. 1
0
 private static IntPtr SetHook(WindowsHookExInterop.KeyboardHook proc)
 {
     using (var module = Process.GetCurrentProcess().MainModule)
     {
         return(WindowsHookExInterop.SetWindowsHookEx(
                    13,
                    proc,
                    GetModuleHandleInterop.GetModuleHandle(module.ModuleName),
                    0));
     }
 }
Esempio n. 2
0
 private static IntPtr SetHook(WindowsHookExInterop.KeyboardHook windowsHookDelegate)
 {
     using (var module = Process.GetCurrentProcess().MainModule)
     {
         return(WindowsHookExInterop.SetWindowsHookEx(
                    WH_KEYBOARD_LL,
                    windowsHookDelegate,
                    GetModuleHandleInterop.GetModuleHandle(module.ModuleName),
                    0));
     }
 }