[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Finds the monitor containing the form with the given window handle.
Source position: forms.pp line 1264
public function TScreen.MonitorFromWindow( |
const Handle: THandle; |
MonitorDefault: TMonitorDefaultTo = mdNearest |
):TMonitor; |
Handle |
|
The window handle to use. |
MonitorDefault |
|
What to return when no monitor was found. |
The monitor found.
MonitorFromWindow is a TMonitor function used to locate monitor where the form represented by the specified window Handle is displayed.
MonitorDefault is a TMonitorDefaultTo enumeration value which indicates the monitor used when the display area for the form is not found on a monitor. See TMonitorDefaultTo for more information about the values in the enumeration and their meanings.
MonitorFromWindow calls MonitorFromWindow in the widgetset class to get a monitor handle used to locate the monitor in the Monitors property. The UpdatedMonitor method is called to ensure that Monitors contains up-to-date values for the available monitors.
If a monitor with the Handle is not found, GetWindowRect is called to get the display areas for the monitor Handle. MonitorFromRect is called to locate the monitor which contains the rectangle.