[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TScreen.MonitorFromPoint

Finds the monitor containing the given screen coordinates.

## Declaration

Source position: forms.pp line 1255

`public function TScreen.MonitorFromPoint(`
`const Point: TPoint;`
`MonitorDefault: TMonitorDefaultTo = mdNearest`
`):TMonitor;`

## Arguments

`Point` |  | The screen coordinates used to find a monitor.
`MonitorDefault` |  | Monitor returned when the coordinates are not found on a monitor.

## Function result

The monitor where the coordinates are located.

## Description

MonitorFromPoint is a TMonitor function used to get the monitor with the coordinates in the Point argument.

MonitorDefault is a TMonitorDefaultTo enumeration value which indicates which monitor to use when the coordinates in Point cannot be located on a screen. See TMonitorDefaultTo for more information about the enumeration values and their meanings.

MonitorFromPoint calls the corresponding method in the widgetset class to get the Handle for the monitor. Values in the Monitors property are checked for the Handle, and the return value is set to the TMonitor instance with the given Handle.

If the Handle is -1 (MONITOR_UNIMPL), the MonitorFromRect method is called to locate a monitor with the origin in Point. Otherwise, the values in Monitors are refreshed to ensure that existing monitors and their handles are up-to-date in the class instance.

MonitorFromPoint is called from the GetMonitor method in TCustomForm, and the AdjustBoundsForMonitor method in THintWindow.

## See also

TScreen.MonitorFromRect |  | Finds the monitor where the specified rectangle is located.