Exemplo n.º 1
0
		public WindowsHook(int hookType, HandleProcMessage messageAction)
		{
			this.messageAction = messageAction;
			int threadId = NativeMethods.GetCurrentThreadId();
			nativeCallbackLifetimeInstance = MessageCallback;
			hookHandle = NativeMethods.SetWindowsHookEx(hookType, nativeCallbackLifetimeInstance,
				IntPtr.Zero, threadId);
		}
Exemplo n.º 2
0
        public WindowsHook(int hookType, HandleProcMessage messageAction)
        {
            this.messageAction = messageAction;
            int threadId = NativeMethods.GetCurrentThreadId();

            nativeCallbackLifetimeInstance = MessageCallback;
            hookHandle = NativeMethods.SetWindowsHookEx(hookType, nativeCallbackLifetimeInstance,
                                                        IntPtr.Zero, threadId);
        }