/// <summary> /// Perofrm mouse hit testing against a screen point. /// </summary> /// <param name="screenPoint">Screen point.</param> /// <returns>Area that is active.</returns> public int ScreenMouseMove(Point screenPoint) { // Convert from screen to client coordinates Point pt = new Point(screenPoint.X - _showRect.X, screenPoint.Y - _showRect.Y); // Remember the current active value int activeBefore = _dragData.ActiveFlags; // Reset active back to nothing _dragData.ClearActive(); // Find new active area if (_dragData.ShowLeft && _dragData.RectLeft.Contains(pt)) _dragData.ActiveLeft = true; if (_dragData.ShowRight && _dragData.RectRight.Contains(pt)) _dragData.ActiveRight = true; if (_dragData.ShowTop && _dragData.RectTop.Contains(pt)) _dragData.ActiveTop = true; if (_dragData.ShowBottom && _dragData.RectBottom.Contains(pt)) _dragData.ActiveBottom = true; // Only consider the middle if the others do not match if ((_dragData.ActiveFlags == 0) && _dragData.ShowMiddle && _dragData.RectMiddle.Contains(pt)) _dragData.ActiveMiddle = true; // Do we need to update the display? if (_dragData.ActiveFlags != activeBefore) UpdateLayeredWindow(_showRect); return _dragData.ActiveFlags; }