예제 #1
0
 /// <summary>
 /// Get the screen containing the given point.
 /// </summary>
 public static Screen FromPoint(Point point)
 {
     var nativePoint = new POINTSTRUCT((int)point.X, (int)point.Y);
     return new Screen(User32WindowFunctions.MonitorFromPoint(nativePoint, MONITOR_DEFAULTTO.NEAREST));
 }
예제 #2
0
 /// <summary>
 /// Get the screen marked as primary (the one that the taskbar is on)
 /// </summary>
 public static Screen GetPrimaryScreen()
 {
     return new Screen(User32WindowFunctions.MonitorFromPoint(new POINTSTRUCT(), MONITOR_DEFAULTTO.PRIMARY));
 }