protected override void OnMouseMove(MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { Point pt = Cursor.Position; IntPtr childWindow = WindowFromPoint(pt); WindowInfo CurWindow = new WindowInfo(GetAncestor(childWindow, GA_ROOT)); if(CurWindow.Equals(LastWindow) == false) OnWindowOver(new WindowSelect_EventArgs(CurWindow)); if (LastWindow == null) { ControlPaint.DrawReversibleFrame(CurWindow.Rect, WindowOutlineColor, WindowOutlineFrameStyle); } else if (CurWindow.Equals(LastWindow) == false) { ControlPaint.DrawReversibleFrame(LastWindow.Rect, WindowOutlineColor, WindowOutlineFrameStyle); ControlPaint.DrawReversibleFrame(CurWindow.Rect, WindowOutlineColor, WindowOutlineFrameStyle); } LastWindow = CurWindow; Cursor.Current = Cursors.Cross; } base.OnMouseMove(e); }
protected override void OnMouseMove(MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { Point pt = Cursor.Position; IntPtr childWindow = WindowFromPoint(pt); WindowInfo CurWindow = new WindowInfo(GetAncestor(childWindow, GA_ROOT)); if (CurWindow.Equals(LastWindow) == false) { OnWindowOver(new WindowSelect_EventArgs(CurWindow)); } if (LastWindow == null) { ControlPaint.DrawReversibleFrame(CurWindow.Rect, WindowOutlineColor, WindowOutlineFrameStyle); } else if (CurWindow.Equals(LastWindow) == false) { ControlPaint.DrawReversibleFrame(LastWindow.Rect, WindowOutlineColor, WindowOutlineFrameStyle); ControlPaint.DrawReversibleFrame(CurWindow.Rect, WindowOutlineColor, WindowOutlineFrameStyle); } LastWindow = CurWindow; Cursor.Current = Cursors.Cross; } base.OnMouseMove(e); }