///<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); } }
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)); }
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); } }
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); } }
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); }
///<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); }