Make sure that HWND comparisons are always done with full 32-bit handles.
diff --git a/controls/combo.c b/controls/combo.c index 9b74ac1..92dddb2 100644 --- a/controls/combo.c +++ b/controls/combo.c
@@ -16,6 +16,7 @@ #include "wine/unicode.h" #include "spy.h" #include "user.h" +#include "win.h" #include "controls.h" #include "debugtools.h" @@ -1941,14 +1942,15 @@ COMBO_SetFocus( lphc ); return TRUE; case WM_KILLFOCUS: -#define hwndFocus ((HWND16)wParam) + { + HWND hwndFocus = WIN_GetFullHandle( (HWND)wParam ); if( !hwndFocus || (hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox )) COMBO_KillFocus( lphc ); -#undef hwndFocus return TRUE; + } case WM_COMMAND: - return COMBO_Command( lphc, wParam, (HWND)lParam ); + return COMBO_Command( lphc, wParam, WIN_GetFullHandle( (HWND)lParam ) ); case WM_GETTEXT: return COMBO_GetText( lphc, (INT)wParam, lParam, unicode ); case WM_SETTEXT:
diff --git a/controls/menu.c b/controls/menu.c index 6092b45..675026d 100644 --- a/controls/menu.c +++ b/controls/menu.c
@@ -353,7 +353,7 @@ { POPUPMENU *menu = MENU_GetMenu(hMenu); menu->wFlags = MF_SYSMENU; - menu->hWnd = hWnd; + menu->hWnd = WIN_GetFullHandle( hWnd ); if (hPopupMenu == (HMENU)(-1)) hPopupMenu = MENU_CopySysPopup(); @@ -2362,7 +2362,7 @@ else /* application returned a new menu to switch to */ { hNewMenu = next_menu.hmenuNext; - hNewWnd = next_menu.hwndNext; + hNewWnd = WIN_GetFullHandle( next_menu.hwndNext ); if( IsMenu(hNewMenu) && IsWindow(hNewWnd) ) { @@ -2609,7 +2609,7 @@ mt.trackFlags = 0; mt.hCurrentMenu = hmenu; mt.hTopMenu = hmenu; - mt.hOwnerWnd = hwnd; + mt.hOwnerWnd = WIN_GetFullHandle( hwnd ); mt.pt.x = x; mt.pt.y = y; @@ -3968,6 +3968,7 @@ } if (GetWindowLongA( hWnd, GWL_STYLE ) & WS_CHILD) return FALSE; + hWnd = WIN_GetFullHandle( hWnd ); if (GetCapture() == hWnd) ReleaseCapture(); if (hMenu != 0)
diff --git a/controls/scroll.c b/controls/scroll.c index d9384ca..9c4501c 100644 --- a/controls/scroll.c +++ b/controls/scroll.c
@@ -791,6 +791,7 @@ ((nBar == SB_VERT) && !(wndPtr->dwStyle & WS_VSCROLL)) || ((nBar == SB_HORZ) && !(wndPtr->dwStyle & WS_HSCROLL))) goto END; if (!WIN_IsWindowDrawable( wndPtr, FALSE )) goto END; + hwnd = wndPtr->hwndSelf; /* make it a full handle */ vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect, &arrowSize, &thumbSize, &thumbPos ); @@ -1516,7 +1517,7 @@ if (info->fMask & SIF_PAGE) info->nPage = infoPtr->Page; if (info->fMask & SIF_POS) info->nPos = infoPtr->CurVal; if ((info->fMask & SIF_TRACKPOS) && (info->cbSize == sizeof(*info))) - info->nTrackPos = (SCROLL_TrackingWin==hwnd) ? SCROLL_TrackingVal : infoPtr->CurVal; + info->nTrackPos = (SCROLL_TrackingWin == WIN_GetFullHandle(hwnd)) ? SCROLL_TrackingVal : infoPtr->CurVal; if (info->fMask & SIF_RANGE) { info->nMin = infoPtr->MinVal;