Ejemplo n.º 1
0
 /// <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());
 }
Ejemplo n.º 2
0
 /// <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());
 }
Ejemplo n.º 3
0
 /// <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());
 }
Ejemplo n.º 4
0
        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());
        }
Ejemplo n.º 5
0
 ///-------------------------------------------------------------------------------------
 /// 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());
 }
Ejemplo n.º 6
0
        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());
        }
Ejemplo n.º 7
0
 /// <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());
 }
Ejemplo n.º 8
0
 /// <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();
 }
Ejemplo n.º 9
0
 static extern IntPtr SetWindowsHookEx(int idHook, GetMsgProc lpfn, IntPtr hmod, int dwThreadId);
Ejemplo n.º 10
0
 public static extern IntPtr SetWindowsHookEx(HookId idHook, GetMsgProc lpfn, IntPtr hmod, int dwThreadId);
Ejemplo n.º 11
0
 public TextInputHook(IntPtr whnd)
 {
     ProcessMessagesCallback = ProcessMessages;
     HookHandle = SetWindowsHookEx(HookId.WH_GETMESSAGE, ProcessMessagesCallback, IntPtr.Zero,
         GetCurrentThreadId());
 }
Ejemplo n.º 12
0
 public TextInputHook(IntPtr whnd)
 {
     ProcessMessagesCallback = ProcessMessages;
     HookHandle = SetWindowsHookEx(HookId.WH_GETMESSAGE, ProcessMessagesCallback, IntPtr.Zero,
                                   GetCurrentThreadId());
 }
Ejemplo n.º 13
0
 private static IntPtr SetHook(GetMsgProc proc, int hookID)
 {
     return(SetWindowsHookEx(hookID, proc, Marshal.GetHINSTANCE(typeof(Intercept).Module), 0));
 }