Inheritance: System.EventArgs
Exemplo n.º 1
0
 internal void OnHookInvoke(HookEventArgs e)
 {
     if (HookInvoke != null)
     {
         HookInvoke(this, e);
     }
 }
Exemplo n.º 2
0
        // handles the hook event
        private void WndProcRetHookInvoked(object sender, HookEventArgs e)
        {
            WndProcRetEventArgs wpe = new WndProcRetEventArgs(e.wParam, e.lParam);

            if ((hWndHooked == IntPtr.Zero || wpe.cw.hwnd == hWndHooked) && WndProcRet != null)
            {
                WndProcRet(this, wpe);
            }
            return;
        }
Exemplo n.º 3
0
        // default hook filter function
        internal int CoreHookProc(int code, IntPtr wParam, IntPtr lParam)
        {
            if (code < 0)
            {
                return(CallNextHookEx(hHook, code, wParam, lParam));
            }

            // let clients determine what to do
            HookEventArgs e = new HookEventArgs(code, wParam, lParam);

            OnHookInvoke(e);

            // yield to the next hook in the chain
            return(CallNextHookEx(hHook, code, wParam, lParam));
        }
Exemplo n.º 4
0
        // handles the hook event
        private void CbtHookInvoked(object sender, HookEventArgs e)
        {
            // handle hook events (only a few of available actions)
            switch ((CbtHookAction)e.code)
            {
            case CbtHookAction.HCBT_CREATEWND:
                HandleCreateWndEvent(e.wParam, e.lParam);
                break;

            case CbtHookAction.HCBT_DESTROYWND:
                HandleDestroyWndEvent(e.wParam, e.lParam);
                break;

            case CbtHookAction.HCBT_ACTIVATE:
                HandleActivateEvent(e.wParam, e.lParam);
                break;
            }
            return;
        }
Exemplo n.º 5
0
		// default hook filter function
		internal int CoreHookProc(int code, IntPtr wParam, IntPtr lParam)
		{
			if (code < 0)
				return CallNextHookEx(hHook, code, wParam, lParam);

			// let clients determine what to do
			HookEventArgs e = new HookEventArgs(code, wParam, lParam);
			OnHookInvoke(e);

			// yield to the next hook in the chain
			return CallNextHookEx(hHook, code, wParam, lParam);
		}
Exemplo n.º 6
0
		internal void OnHookInvoke(HookEventArgs e)
		{
			if (HookInvoke != null)
				HookInvoke(this, e);
		}
Exemplo n.º 7
0
 // handles the hook event
 private void CbtHookInvoked(object sender, HookEventArgs e)
 {
     // handle hook events (only a few of available actions)
     switch ((CbtHookAction)e.code)
     {
         case CbtHookAction.HCBT_CREATEWND:
             HandleCreateWndEvent(e.wParam, e.lParam);
             break;
         case CbtHookAction.HCBT_DESTROYWND:
             HandleDestroyWndEvent(e.wParam, e.lParam);
             break;
         case CbtHookAction.HCBT_ACTIVATE:
             HandleActivateEvent(e.wParam, e.lParam);
             break;
     }
     return;
 }
Exemplo n.º 8
0
 // handles the hook event
 private void WndProcRetHookInvoked(object sender, HookEventArgs e)
 {
     WndProcRetEventArgs wpe = new WndProcRetEventArgs(e.wParam, e.lParam);
     if ((hWndHooked == IntPtr.Zero || wpe.cw.hwnd == hWndHooked) && WndProcRet != null)
         WndProcRet(this, wpe);
     return;
 }