Home | Info | Community | Development | myReactOS | Contact Us
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; }