SetHook() private static method

private static SetHook ( LowLevelKeyboardProc proc ) : IntPtr
proc LowLevelKeyboardProc
return IntPtr
Example #1
0
 public static void Run()
 {
     InterceptKeys.callback = new InterceptKeys.CallBack(MySelector);
     InterceptKeys._hookID  = InterceptKeys.SetHook(InterceptKeys._proc);
     Application.Run();
     InterceptKeys.UnhookWindowsHookEx(InterceptKeys._hookID);
 }
Example #2
0
        public Controller()
        {
            _random = new Random();

            try
            {
                _hookID = InterceptKeys.SetHook(_proc);
            }
            catch
            {
                DetachKeyboardHook();
            }

            InitializeComponent();
        }
Example #3
0
 private void textBlockKeys_GotFocus(object sender, RoutedEventArgs e)
 {
     interceptKeys.OnKeyDown += interceptKeys_OnKeyDown;
     interceptKeys.SetHook();
 }
 public KeyboardListener()
 {
     hookId = InterceptKeys.SetHook((InterceptKeys.LowLevelKeyboardProc)HookCallback);
 }
Example #5
0
        static KeyboardHook()
        {
            IntPtr hookId = InterceptKeys.SetHook(_handler);

            AppDomain.CurrentDomain.ProcessExit += (s, e) => InterceptKeys.UnhookWindowsHookEx(hookId);
        }