ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Definition at line 926 of file monitor.c.

Referenced by MonitorFromWindow().

{
    PWND pWnd;
    HMONITOR hMonitor = NULL;
    RECTL Rect = {0, 0, 0, 0};

    TRACE("Enter NtUserMonitorFromWindow\n");

    /* Check if flags are valid */
    if (dwFlags != MONITOR_DEFAULTTONULL &&
        dwFlags != MONITOR_DEFAULTTOPRIMARY &&
        dwFlags != MONITOR_DEFAULTTONEAREST)
    {
        EngSetLastError(ERROR_INVALID_FLAGS);
        return NULL;
    }

    UserEnterShared();

    /* If window is given, use it first */
    if (hWnd)
    {
        /* Get window object */
        pWnd = UserGetWindowObject(hWnd);
        if (!pWnd)
            goto cleanup;

        /* Find only monitors which have intersection with given window */
        Rect.left = Rect.right = pWnd->rcWindow.left;
        Rect.top = Rect.bottom = pWnd->rcWindow.bottom;
    }

    /* Find monitors now */
    IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags);

cleanup:
    TRACE("Leave NtUserMonitorFromWindow, ret=%p\n", hMonitor);
    UserLeave();
    return hMonitor;
}

Generated on Sun May 27 2012 06:11:29 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.