예제 #1
0
 protected void OnHookInvoked(HookEventArgs e)
 {
     if (HookInvoked != null)
         HookInvoked(this, e);
 }
예제 #2
0
 void handleHookInvoked(object sender, HookEventArgs e)
 {
     int vkCode = Marshal.ReadInt32(e.lParam);
     if ((Keys)vkCode == Keys.Pause && e.wParam == (IntPtr)UnsaveNativeMethods.WM_KEYDOWN) {
         toggleCurrentProcessVisibility();
     }
 }
예제 #3
0
        public int CoreHookProc(int code, IntPtr wParam, IntPtr lParam)
        {
            if (code < 0)
                return CallNextHookEx(m_hhook, code, wParam, lParam);

            // Let clients determine what to do
            HookEventArgs e = new HookEventArgs();
            e.HookCode = code;
            e.wParam = wParam;
            e.lParam = lParam;
            OnHookInvoked(e);

            // Yield to the next hook in the chain
            return CallNextHookEx(m_hhook, code, wParam, lParam);
        }