Share via


Gdi::MonitorFromWindow_I (Windows CE 5.0)

Send Feedback

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

static HMONITOR WINAPI MonitorFromWindow_I(HWND hwnd,DWORD dwFlag);

Parameters

  • hwnd
    [in] Handle to the window of interest.

  • dwFlag
    [in] DWORD that determines the return value of the method when the window does not intersect any screen.

    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 window.
    MONITOR_DEFAULTTONULL The return value is NULL.
    MONITOR_DEFAULTTOPRIMARY The return value is a handle to the primary screen.

Return Values

If the window 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 window.

If the window does not intersect a screen, the return value depends on the value of dwFlag.

Remarks

This method is an internal version of the MonitorFromWindow function.

If the window is minimized, Gdi::MonitorFromWindow_I uses the rectangle of the window before it was minimized.

Requirements

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

See Also

Gdi | MonitorFromWindow | Gdi::MonitorFromPoint_I | Gdi::MonitorFromRect_I

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.