Пример #1
0
        ///<summary>
        ///MouseHookedイベントを発生させる。
        ///</summary>
        ///<param name="e">イベントのデータ。</param>
        protected virtual void OnMouseHooked(MouseHookedEventArgs e)
        {
            MouseHookedEventHandler handler = base.Events[EventMouseHooked] as MouseHookedEventHandler;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Пример #2
0
 private int CallNextHook(int code, MouseMessage message, ref MouseState state)
 {
     if (code >= 0)
     {
         MouseHookedEventArgs e = new MouseHookedEventArgs(message, ref state);
         this.OnMouseHooked(e);
         if (e.Cancel)
         {
             return(-1);
         }
     }
     return(CallNextHookEx(hook, code, message, ref state));
 }
Пример #3
0
 void m_MouseHooked(object sender, MouseHookedEventArgs e)
 {
     if (e.Message == MouseMessage.LDown || e.Message == MouseMessage.RDown)
     {
         TimeSpan ts = DateTime.Now - lastCaptured;
         if (ts.TotalSeconds < 0.5)
         {
             return; //とりあえず0.5秒以内のクリックは無視しておく
         }
         lastCaptured = DateTime.Now;
         System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(DoCapture));
         t.Start(e.Message);
     }
 }
Пример #4
0
        void m_MouseHooked(object sender, MouseHookedEventArgs e)
        {
            if (e.Message == MouseMessage.LDown || e.Message == MouseMessage.RDown)
            {
                TimeSpan ts = DateTime.Now - lastCaptured;
                if (ts.TotalSeconds < 0.5)
                    return; //とりあえず0.5秒以内のクリックは無視しておく

                lastCaptured = DateTime.Now;
                System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(DoCapture));
                t.Start(e.Message);
            }
        }
Пример #5
0
 private int CallNextHook(int code, MouseMessage message, ref MouseState state)
 {
     if (code >= 0)
     {
         MouseHookedEventArgs e = new MouseHookedEventArgs(message, ref state);
         this.OnMouseHooked(e);
         if (e.Cancel)
             return -1;
     }
     return CallNextHookEx(hook, code, message, ref state);
 }
Пример #6
0
 ///<summary>
 ///MouseHookedイベントを発生させる。
 ///</summary>
 ///<param name="e">イベントのデータ。</param>
 protected virtual void OnMouseHooked(MouseHookedEventArgs e)
 {
     MouseHookedEventHandler handler = base.Events[EventMouseHooked] as MouseHookedEventHandler;
     if (handler != null)
         handler(this, e);
 }