コード例 #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]);
        }
コード例 #2
0
 private static extern IntPtr MonitorFromPoint(W32POINT pt, MultiMonFlags dwFlags);
コード例 #3
0
 public static extern bool ClientToScreen(IntPtr hWnd, ref W32POINT lpPoint);
コード例 #4
0
 public static extern IntPtr WindowFromPoint(W32POINT Point);
コード例 #5
0
 public static System.Drawing.Point GetDrawingPoint(W32POINT input)
 {
     return(new System.Drawing.Point(input.x, input.y));
 }