/// <summary>Creates a instance of a the KeyboardInput class. </summary> internal KeyboardInput() { // Create the delegate callback: this.processMessagesCallback = processMessages; // Create the keyboard hook: this.hookHandle = SetWindowsHookEx(HookId.WH_GETMESSAGE, this.processMessagesCallback, IntPtr.Zero, GetCurrentThreadId()); }
/// <summary>Create an instance of the TextInputHandler.</summary> /// <param name="whnd">Handle of the window you wish to receive messages (and thus keyboard input) from.</param> public WinInputHook(IntPtr whnd) { // Create the delegate callback: this.ProcessMessagesCallback = new GetMsgProc(ProcessMessages); // Create the keyboard hook: this.HookHandle = SetWindowsHookEx(HookId.WH_GETMESSAGE, this.ProcessMessagesCallback, IntPtr.Zero, GetCurrentThreadId()); }
/// <summary>Create an instance of the TextInputHandler.</summary> /// <param name="whnd">Handle of the window you wish to receive messages (and thus keyboard input) from.</param> public TextInput(IntPtr whnd) { // Create the delegate callback: this.ProcessMessagesCallback = new GetMsgProc(ProcessMessages); // Create the keyboard hook: this.HookHandle = SetWindowsHookEx(HookId.WH_GETMESSAGE, this.ProcessMessagesCallback, IntPtr.Zero, GetCurrentThreadId()); }
public MessageHook(IntPtr whnd) { // Need to keep this reference to avoid crashing getMsgProc = new GetMsgProc(ProcessMessages); // Create the keyboard hook HookHandle = SetWindowsHookEx(WH_GETMESSAGE, getMsgProc, IntPtr.Zero, GetCurrentThreadId()); }
///------------------------------------------------------------------------------------- /// Create an instance of the TextInputHandler. /// Handle of the window you wish to receive messages (and thus keyboard input) from. ///------------------------------------------------------------------------------------- public KeyboardBuffer(IntPtr whnd) { // create the delegate callback // create the keyboard hook ProcessMessagesCallback = new GetMsgProc(ProcessMessages); //this.HookHandle = SetWindowsHookEx(HookId.WH_GETMESSAGE, this.ProcessMessagesCallback, //IntPtr.Zero, GetCurrentThreadId()); }
/// <summary>Create an instance of the TextInputHandler.</summary> /// <param name="whnd">Handle of the window you wish to receive messages (and thus keyboard input) from.</param> private TextInput(IntPtr whnd) { // Create the delegate callback: this.ProcessMessagesCallback = ProcessMessages; // Create the keyboard hook: this.HookHandle = SetWindowsHookEx(HookId.WH_GETMESSAGE, this.ProcessMessagesCallback, IntPtr.Zero, GetCurrentThreadId()); }
/// <summary> /// Create an instance of the TextInputHandler. /// </summary> /// <param name="whnd">Handle of the window you wish to receive messages (and thus keyboard input) from.</param> public InputHandler(IntPtr whnd) { // Create the delegate callback: this.ProcessMessagesCallback = new GetMsgProc(ProcessMessages); // Create the keyboard hook: this.HookHandle = SetWindowsHookEx(HookType.WH_GETMESSAGE, this.ProcessMessagesCallback, IntPtr.Zero, GetCurrentThreadId()); // Create a new key event holder. this.events = new InputEvents(); }
static extern IntPtr SetWindowsHookEx(int idHook, GetMsgProc lpfn, IntPtr hmod, int dwThreadId);
public static extern IntPtr SetWindowsHookEx(HookId idHook, GetMsgProc lpfn, IntPtr hmod, int dwThreadId);
public TextInputHook(IntPtr whnd) { ProcessMessagesCallback = ProcessMessages; HookHandle = SetWindowsHookEx(HookId.WH_GETMESSAGE, ProcessMessagesCallback, IntPtr.Zero, GetCurrentThreadId()); }
private static IntPtr SetHook(GetMsgProc proc, int hookID) { return(SetWindowsHookEx(hookID, proc, Marshal.GetHINSTANCE(typeof(Intercept).Module), 0)); }