From 798afcf902071d14a71e3855e3a6b3732d778019 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Thu, 3 Jul 2008 11:37:14 -0400 Subject: [PATCH] comctl32: Fix for ComboBoxEx bug caused by focus change. --- dlls/comctl32/comboex.c | 3 +++ dlls/comctl32/tests/comboex.c | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 664d0a2c053..afd4f824d6a 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -1267,6 +1267,9 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa InvalidateRect (infoPtr->hwndCombo, 0, 0); return 0; + case CBN_SETFOCUS: + return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf); + default: /* * We have to change the handle since we are the control diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c index dbd9c6eb36c..eca7ca4b6ee 100644 --- a/dlls/comctl32/tests/comboex.c +++ b/dlls/comctl32/tests/comboex.c @@ -221,7 +221,7 @@ static void test_WM_LBUTTONDOWN(void) result = SendMessage(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y)); ok(result, "WM_LBUTTONDOWN was not processed. LastError=%d\n", GetLastError()); - todo_wine ok(GetFocus() == hCombo, + ok(GetFocus() == hCombo, "Focus not on ComboBoxEx's ComboBox Control, instead on %p\n", GetFocus()); ok(SendMessage(hComboEx, CB_GETDROPPEDSTATE, 0, 0), @@ -232,7 +232,7 @@ static void test_WM_LBUTTONDOWN(void) result = SendMessage(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y)); ok(result, "WM_LBUTTONUP was not processed. LastError=%d\n", GetLastError()); - todo_wine ok(GetFocus() == hCombo, + ok(GetFocus() == hCombo, "Focus not on ComboBoxEx's ComboBox Control, instead on %p\n", GetFocus()); @@ -244,23 +244,23 @@ static void test_WM_LBUTTONDOWN(void) result = SendMessage(hList, WM_MOUSEMOVE, 0, MAKELPARAM(x, y)); ok(!result, "WM_MOUSEMOVE was not processed. LastError=%d\n", GetLastError()); - todo_wine ok(GetFocus() == hCombo, + ok(GetFocus() == hCombo, "Focus not on ComboBoxEx's ComboBox Control, instead on %p\n", GetFocus()); result = SendMessage(hList, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y)); ok(!result, "WM_LBUTTONDOWN was not processed. LastError=%d\n", GetLastError()); - todo_wine ok(GetFocus() == hCombo, + ok(GetFocus() == hCombo, "Focus not on ComboBoxEx's ComboBox Control, instead on %p\n", GetFocus()); - todo_wine ok(SendMessage(hComboEx, CB_GETDROPPEDSTATE, 0, 0), + ok(SendMessage(hComboEx, CB_GETDROPPEDSTATE, 0, 0), "The dropdown list should still be visible.\n"); result = SendMessage(hList, WM_LBUTTONUP, 0, MAKELPARAM(x, y)); ok(!result, "WM_LBUTTONUP was not processed. LastError=%d\n", GetLastError()); - ok(GetFocus() == hEdit, + todo_wine ok(GetFocus() == hEdit, "Focus not on ComboBoxEx's Edit Control, instead on %p\n", GetFocus()); ok(!SendMessage(hCombo, CB_GETDROPPEDSTATE, 0, 0),