A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



MonitorFromPoint

The MonitorFromPoint function retrieves a handle to the display monitor that contains a specified point.

VB4-32,5,6
Declare Function MonitorFromPoint Lib "user32.dll" (ByVal x As Long, ByVal y As Long, ByVal dwFlags As Long) As Long

VB.NET
System.Windows.Forms.Screen.FromPoint

Operating Systems Supported
Requires Windows 2000 or later; Requires Windows 98 or later

Library
User32

Parameter Information
- pt
[in] A POINT structure that specifies the point of interest in virtual-screen coordinates.

- dwFlags
[in] Determines the function's return value if the point is not contained within any display monitor.
This parameter can be one of the following values.
MONITOR_DEFAULTTONEAREST
Returns a handle to the display monitor that is nearest to the point.
MONITOR_DEFAULTTONULL
Returns NULL.
MONITOR_DEFAULTTOPRIMARY
Returns a handle to the primary display monitor.

Return Values
If the point is contained by a display monitor, the return value is an HMONITOR handle to that display monitor.

If the point is not contained by a display monitor, the return value depends on the value of dwFlags.

Last update: 07 April 2006