|
MonitorFromWindow The MonitorFromWindow function retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window. VB4-32,5,6 Declare Function MonitorFromWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal dwFlags As Long) As Long |
VB.NET System.Windows.Forms.Screen.FromControl |
Operating Systems Supported |
Requires Windows 2000 or later; Requires Windows 98 or later |
· hwnd [in] Handle to the window of interest.
· dwFlags [in] Determines the function's return value if the window does not intersect 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 window. MONITOR_DEFAULTTONULL Returns NULL. MONITOR_DEFAULTTOPRIMARY Returns a handle to the primary display monitor. |
If the window intersects one or more display monitor rectangles, the return value is an HMONITOR handle to the display monitor that has the largest area of intersection with the window.
If the window does not intersect a display monitor, the return value depends on the value of dwFlags. |
|
|
|