user: Fixed combo box drop position on multi-monitor setups.

This commit is contained in:
Alexandre Julliard 2006-10-23 14:04:42 +02:00
parent ca58c8179f
commit 30a25defb3
1 changed files with 7 additions and 1 deletions

View File

@ -1052,6 +1052,8 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
*/ */
static void CBDropDown( LPHEADCOMBO lphc ) static void CBDropDown( LPHEADCOMBO lphc )
{ {
HMONITOR monitor;
MONITORINFO mon_info;
RECT rect,r; RECT rect,r;
int nItems = 0; int nItems = 0;
int nDroppedHeight; int nDroppedHeight;
@ -1123,7 +1125,11 @@ static void CBDropDown( LPHEADCOMBO lphc )
} }
/*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.*/
if( (rect.bottom + nDroppedHeight) >= GetSystemMetrics( SM_CYSCREEN ) ) monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
mon_info.cbSize = sizeof(mon_info);
GetMonitorInfoW( monitor, &mon_info );
if( (rect.bottom + nDroppedHeight) >= mon_info.rcWork.bottom )
rect.bottom = rect.top - nDroppedHeight; rect.bottom = rect.top - nDroppedHeight;
SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom, SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom,