// This is the Constructor. This is the code that runs every time you create a new GlobalKeyboardHook object
 public GlobalKeyboardHook()
 {
     llkh = new LLKeyboardHook(HookProc);
     // This starts the hook. You can leave this as comment and you have to start it manually (the thing I do in the tutorial, with the button)
     // Or delete the comment mark and your hook will start automatically when your program starts (because a new GlobalKeyboardHook object is created)
     // That's why there are duplicates, because you start it twice! I'm sorry, I haven't noticed this...
     // hook(); <-- Choose!
 }
Exemplo n.º 2
0
 public GlobalKeyboardHook()
 {
     llkh = new LLKeyboardHook(HookProc);
     // This starts the hook. You can leave this as comment and you have to start it manually (the thing I do in the tutorial, with the button)
     // Or delete the comment mark and your hook will start automatically when your program starts (because a new GlobalKeyboardHook object is created)
     // That's why there are duplicates, because you start it twice! I'm sorry, I haven't noticed this...
     // hook(); <-- Choose!
 }
        public ActivityHook()
        {
            llkh = new LLKeyboardHook(HookProc);

            foreach (Keys key in Enum.GetValues(typeof(Keys)))
            {
                HookedKeys.Add(key);
            }
        }
Exemplo n.º 4
0
        public Form1()
        {
            InitializeComponent();
            timer1.Start();

            #region Part 2 keyboard hook
            llkh = new LLKeyboardHook(HookProc);
            IntPtr hInstance = LoadLibrary("User32");
            Hook = SetWindowsHookEx(WH_KEYBOARD_LL, llkh, hInstance, 0);
            #endregion
        }
 static extern IntPtr SetWindowsHookEx(int idHook, LLKeyboardHook callback, IntPtr hInstance, uint theardID);
 private static extern IntPtr SetWindowsHookEx(int idHook, LLKeyboardHook callback, IntPtr hInstance, uint theardID);
 public GlobalKeyboardHookInternal()
 {
     llkh = new LLKeyboardHook(HookProc);
 }
Exemplo n.º 8
0
 public KeyHooker()
 {
     llkh = new LLKeyboardHook(HookProc);
 }
Exemplo n.º 9
0
 public GlobalKeyboardHook()
 {
     llkh = new LLKeyboardHook(HookProc);
     llmh = new LLMouseHook(mouseHookProc);
 }
Exemplo n.º 10
0
 public KeyboardHook()
 {
     llkh = new LLKeyboardHook(HookProc);
 }
 // This is the Constructor. This is the code that runs every time you create a new GlobalKeyboardHook object
 public GlobalKeyboardHook()
 {
     llkh = new LLKeyboardHook(HookProc);
 }
Exemplo n.º 12
0
 public GlobalKeyboardHook()
 {
     llkh = new LLKeyboardHook(HookProc);
     hook();
 }