Esempio 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);
		}
Esempio 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);
        }