Пример #1
0
 /// <summary>
 /// Raises the MouseHookEvent event.
 /// </summary>
 /// <param name="e">The MouseHook event details associated
 /// with this mouse hook event.</param>
 protected virtual void OnMouseHookEvent(ref MouseHookEventArgs e)
 {
     if (MouseHookEvent != null)
     {
         MouseHookEvent(this, ref e);
     }
 }
Пример #2
0
 private void mouseHook_MouseHookEvent(object sender, ref MouseHookEventArgs e)
 {
     if (e.Button != MouseButtons.None)
     {
         OnPopupCancel(new EventArgs());
     }
 }
Пример #3
0
        /// <summary>
        /// Override for the generic hook's invoked event to
        /// convert to a strongly typed MouseHookEvent:
        /// </summary>
        /// <param name="e">Generic Hook event argument details</param>
        protected override void OnHookInvoked(ref HookEventArgs e)
        {
            // Convert into mouse details:
            MOUSEHOOKSTRUCT mhs = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(
                e.lParam, typeof(MOUSEHOOKSTRUCT));

            MouseHookEventArgs mhe = new MouseHookEventArgs(
                e.wParam, mhs);

            OnMouseHookEvent(ref mhe);
        }