Exemple #1
0
        /// <summary>
        /// Retrieves the monitor at the given point.
        /// </summary>
        /// <param name="pt"></param>
        /// <returns></returns>
        public MonitorInfo GetMonitorFromPoint(W32POINT pt, MultiMonFlags flags = MultiMonFlags.DefaultToNearest)
        {
            if (Count == 0)
            {
                Refresh();
            }

            var h = MonitorFromPoint(pt, flags);

            if (h == IntPtr.Zero)
            {
                return(null);
            }
            foreach (var m in this)
            {
                if (m.hMonitor == h)
                {
                    return(m);
                }
            }

            return(this[0]);
        }
Exemple #2
0
 private static extern IntPtr MonitorFromPoint(W32POINT pt, MultiMonFlags dwFlags);
 public static extern bool ClientToScreen(IntPtr hWnd, ref W32POINT lpPoint);
 public static extern IntPtr WindowFromPoint(W32POINT Point);
 public static System.Drawing.Point GetDrawingPoint(W32POINT input)
 {
     return(new System.Drawing.Point(input.x, input.y));
 }