[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 1258
public function TScreen.MonitorFromWindow( |
const Handle: TLCLHandle; |
MonitorDefault: TMonitorDefaultTo = mdNearest |
):TMonitor; |
Handle |
|
The TLCLHandle instance on the monitor located in the method. |
MonitorDefault |
|
What to return if a monitor was found. |
The TMonitor instance found for the specified handle.
MonitorFromWindow is a TMonitor function used to locate the 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 the MonitorFromWindow routine in the LCL interface to get the HMONITOR handle to locate in the Monitors property. The UpdatedMonitors method is called to ensure that Monitors contains up-to-date values for the available monitors.
If the handle is found in Monitors, the TMonitor instance with the handle is used as the return value.
If a monitor is not found, GetWindowRect is called to get the display area for the TLCLHandle specified in the Handle argument. MonitorFromRect is called to locate the monitor which contains the rectangle. The TMonitor instance is used as the return value.
MonitorFromWindow is called from methods like TCustomForm.GetMonitor.
Modified in LCL version 4.0 to use the TLCLHandle type instead of the deprecated THandle type in the Handle parameter.
|
Handle which identifies this monitor to the system. |
|
|
The monitor to use when screen coordinates are outside of the physical bounds for the screens. |
|
|
The type of a display Monitor (CRT...) Handle. |
Version 4.0 | Generated 2025-05-03 | Home |