comctl32: Fix to ComboBoxEx processing of WM_ENABLE message=0A= comctl32/tests: Test for ComboBoxEx correct processing of WM_ENABLE =
Richard Bradbrook
richard at bradders2000.co.uk
Wed Aug 3 15:26:19 CDT 2011
message=0A=
=0A=
---=0A=
dlls/comctl32/comboex.c | 17 +++++++++++++++++=0A=
dlls/comctl32/tests/comboex.c | 30 ++++++++++++++++++++++++++++++=0A=
2 files changed, 47 insertions(+), 0 deletions(-)=0A=
=0A=
diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c=0A=
index b8cb359..9615983 100644=0A=
--- a/dlls/comctl32/comboex.c=0A=
+++ b/dlls/comctl32/comboex.c=0A=
@@ -1598,6 +1598,20 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO =
*infoPtr)=0A=
}=0A=
=0A=
=0A=
+static LRESULT COMBOEX_Enable (COMBOEX_INFO *infoPtr, BOOL enable)=0A=
+{=0A=
+ if (infoPtr->hwndEdit)=0A=
+ EnableWindow(infoPtr->hwndEdit, enable);=0A=
+=0A=
+ EnableWindow(infoPtr->hwndCombo, enable);=0A=
+=0A=
+ /* Force the control to repaint when the enabled state changes. */=0A=
+ InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);=0A=
+=0A=
+ return 1;=0A=
+}=0A=
+=0A=
+=0A=
static LRESULT COMBOEX_MeasureItem (COMBOEX_INFO const *infoPtr, =
MEASUREITEMSTRUCT *mis)=0A=
{=0A=
static const WCHAR strW[] =3D { 'W', 0 };=0A=
@@ -2278,6 +2292,9 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM =
wParam, LPARAM lParam)=0A=
case WM_DESTROY:=0A=
return COMBOEX_Destroy (infoPtr);=0A=
=0A=
+ case WM_ENABLE:=0A=
+ return COMBOEX_Enable (infoPtr, (BOOL)wParam);=0A=
+=0A=
case WM_MEASUREITEM:=0A=
return COMBOEX_MeasureItem (infoPtr, (MEASUREITEMSTRUCT =
*)lParam);=0A=
=0A=
diff --git a/dlls/comctl32/tests/comboex.c =
b/dlls/comctl32/tests/comboex.c=0A=
index 172e564..2fb4ef8 100644=0A=
--- a/dlls/comctl32/tests/comboex.c=0A=
+++ b/dlls/comctl32/tests/comboex.c=0A=
@@ -593,6 +593,35 @@ static void test_get_set_item(void)=0A=
DestroyWindow(hComboEx);=0A=
}=0A=
=0A=
+static void test_WM_ENABLE(void)=0A=
+{=0A=
+ HWND hComboEx, hCombo, hEdit;=0A=
+ BOOL ret;=0A=
+=0A=
+ hComboEx =3D createComboEx(WS_BORDER | WS_VISIBLE | WS_CHILD | =
CBS_DROPDOWN);=0A=
+=0A=
+ hCombo =3D (HWND)SendMessage(hComboEx, CBEM_GETCOMBOCONTROL, 0, 0);=0A=
+ ok(hCombo !=3D NULL, "Failed to get internal combo\n");=0A=
+ hEdit =3D (HWND)SendMessage(hComboEx, CBEM_GETEDITCONTROL, 0, 0);=0A=
+ ok(hEdit !=3D NULL, "Failed to get internal edit\n");=0A=
+=0A=
+ EnableWindow(hComboEx, FALSE);=0A=
+=0A=
+ ret =3D IsWindowEnabled(hCombo);=0A=
+ ok(ret =3D=3D FALSE, "Internal combo should be disabled but =
isn't\n");=0A=
+ ret =3D IsWindowEnabled(hEdit);=0A=
+ ok(ret =3D=3D FALSE, "Internal edit should be disabled but =
isn't\n");=0A=
+=0A=
+ EnableWindow(hComboEx, TRUE);=0A=
+=0A=
+ ret =3D IsWindowEnabled(hCombo);=0A=
+ ok(ret =3D=3D TRUE, "Internal combo should be enabled but isn't\n");=0A=
+ ret =3D IsWindowEnabled(hEdit);=0A=
+ ok(ret =3D=3D TRUE, "Internal edit should be enabled but isn't\n");=0A=
+=0A=
+ DestroyWindow(hComboEx);=0A=
+}=0A=
+=0A=
START_TEST(comboex)=0A=
{=0A=
if (!init())=0A=
@@ -606,6 +635,7 @@ START_TEST(comboex)=0A=
test_WM_WINDOWPOSCHANGING();=0A=
test_comboboxex_subclass();=0A=
test_get_set_item();=0A=
+ test_WM_ENABLE();=0A=
=0A=
cleanup();=0A=
}=0A=
-- =0A=
1.7.4.1=0A=
=0A=
------=_NextPart_000_0101_01CC51F2.C537B680--
More information about the wine-patches
mailing list