Exemplo n.º 1
0
 public MessageHook(IntPtr window)
 {
     int threadId = GetWindowThreadProcessId(window, IntPtr.Zero);
     IntPtr hr;
     if ((hr = SetWindowsHookEx( /*WH_GETMESSAGE*/ 3,
             (proc = __MessageHookProc), IntPtr.Zero, threadId)) == IntPtr.Zero)
     {
         throw new Win32Exception();
     }
     hookfunc = hr;
 }
Exemplo n.º 2
0
        public MessageHook(IntPtr window)
        {
            int    threadId = GetWindowThreadProcessId(window, IntPtr.Zero);
            IntPtr hr;

            if ((hr = SetWindowsHookEx(/*WH_GETMESSAGE*/ 3,
                                       (proc = __MessageHookProc), IntPtr.Zero, threadId)) == IntPtr.Zero)
            {
                throw new Win32Exception();
            }
            hookfunc = hr;

            form = (Form)Form.FromHandle(window);
        }
Exemplo n.º 3
0
 static extern IntPtr SetWindowsHookEx(int type, MessageHookProc hook, IntPtr module, int threadId);
Exemplo n.º 4
0
 extern static IntPtr SetWindowsHookEx(int type, MessageHookProc hook, IntPtr module, int threadId);