Partager via


Gdi::MonitorFromRect_I

This method retrieves a handle to the screen that has the largest area of intersection with a specified rectangle.

static HMONITOR WINAPI MonitorFromRect_I(
  LPCRECT lprc,
  DWORD dwFlag
);

Parameters

  • lprc
    [in] Pointer to a RECT structure that specifies the coordinates of the rectangle of interest in virtual screen coordinates.
  • dwFlag
    [in] DWORD that determines the return value of the method when the rectangle does not intersect any of the screens. The following table shows a list of possible return values.
    Value Description
    MONITOR_DEFAULTTONEAREST The return value is a handle to the screen that is nearest to the rectangle.
    MONITOR_DEFAULTTONULL The return value is NULL.
    MONITOR_DEFAULTTOPRIMARY The return value is a handle to the primary screen.

Return Values

If the rectangle intersects one or more screen rectangles, the return value is an HMONITOR handle to the screen that has the largest area of intersection with the rectangle. If the rectangle does not intersect a screen, the return value depends on the value of dwFlag.

Remarks

This method is an internal version of the MonitorFromRect function.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Gdi.hpp.

See Also

MonitorFromPoint | Gdi::MonitorFromPoint_I | Gdi::MonitorFromWindow_I | RECT

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.