comctl32/comboex: Fix incorrect use of the ScreenToClient function.

This commit is contained in:
Alexandre Julliard 2010-10-05 14:03:25 +02:00
parent d1f8eb49fe
commit 4b4c1a0060
1 changed files with 7 additions and 12 deletions

View File

@ -431,18 +431,13 @@ static void COMBOEX_ReSize (const COMBOEX_INFO *infoPtr)
if (infoPtr->hwndCombo) {
SendMessageW (infoPtr->hwndCombo, CB_SETITEMHEIGHT, 0, cy);
if ( !(infoPtr->flags & CBES_EX_NOSIZELIMIT)) {
RECT comboRect;
if (GetWindowRect(infoPtr->hwndCombo, &comboRect)) {
RECT ourRect;
if (GetWindowRect(infoPtr->hwndSelf, &ourRect)) {
if (comboRect.bottom > ourRect.bottom) {
POINT pt = { ourRect.left, ourRect.top };
if (ScreenToClient(infoPtr->hwndSelf, &pt))
MoveWindow( infoPtr->hwndSelf, pt.x, pt.y, ourRect.right - ourRect.left,
comboRect.bottom - comboRect.top, FALSE);
}
}
}
RECT comboRect, ourRect;
GetWindowRect(infoPtr->hwndCombo, &comboRect);
GetWindowRect(infoPtr->hwndSelf, &ourRect);
if (comboRect.bottom > ourRect.bottom)
SetWindowPos( infoPtr->hwndSelf, 0, 0, 0, ourRect.right - ourRect.left,
comboRect.bottom - comboRect.top,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW );
}
}
}