user32: Keep the combo listbox within the monitor's work area.
This commit is contained in:
parent
46919f2154
commit
b4b99697f9
@ -1043,18 +1043,24 @@ static void CBDropDown( LPHEADCOMBO lphc )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r.left = rect.left;
|
||||||
|
r.top = rect.bottom;
|
||||||
|
r.right = r.left + lphc->droppedRect.right - lphc->droppedRect.left;
|
||||||
|
r.bottom = r.top + nDroppedHeight;
|
||||||
|
|
||||||
/*If height of dropped rectangle gets beyond a screen size it should go up, otherwise down.*/
|
/*If height of dropped rectangle gets beyond a screen size it should go up, otherwise down.*/
|
||||||
monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
|
monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
|
||||||
mon_info.cbSize = sizeof(mon_info);
|
mon_info.cbSize = sizeof(mon_info);
|
||||||
GetMonitorInfoW( monitor, &mon_info );
|
GetMonitorInfoW( monitor, &mon_info );
|
||||||
|
|
||||||
if( (rect.bottom + nDroppedHeight) >= mon_info.rcWork.bottom )
|
if (r.bottom > mon_info.rcWork.bottom)
|
||||||
rect.bottom = rect.top - nDroppedHeight;
|
{
|
||||||
|
r.top = max( rect.top - nDroppedHeight, mon_info.rcWork.top );
|
||||||
|
r.bottom = min( r.top + nDroppedHeight, mon_info.rcWork.bottom );
|
||||||
|
}
|
||||||
|
|
||||||
SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom,
|
SetWindowPos( lphc->hWndLBox, HWND_TOP, r.left, r.top, r.right - r.left, r.bottom - r.top,
|
||||||
lphc->droppedRect.right - lphc->droppedRect.left,
|
SWP_NOACTIVATE | SWP_SHOWWINDOW );
|
||||||
nDroppedHeight,
|
|
||||||
SWP_NOACTIVATE | SWP_SHOWWINDOW);
|
|
||||||
|
|
||||||
|
|
||||||
if( !(lphc->wState & CBF_NOREDRAW) )
|
if( !(lphc->wState & CBF_NOREDRAW) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user