// 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! }
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); } }
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); }
public KeyHooker() { llkh = new LLKeyboardHook(HookProc); }
public GlobalKeyboardHook() { llkh = new LLKeyboardHook(HookProc); llmh = new LLMouseHook(mouseHookProc); }
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); }
public GlobalKeyboardHook() { llkh = new LLKeyboardHook(HookProc); hook(); }