From f5d4244f717bfd92ac87ebf3517971d415903239 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 18 May 2000 00:16:53 +0000 Subject: [PATCH] Sheri Steeves The edit is now detected correctly if the parent is a combo box. It wasn't working when the combobox was superclassed. --- controls/edit.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/controls/edit.c b/controls/edit.c index 798d665d290..5f8548d6052 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -3335,8 +3335,25 @@ static BOOL EDIT_CheckCombo(WND *wnd, UINT msg, INT key, DWORD key_data) { HWND hLBox; - if (WIDGETS_IsControl(wnd->parent, BIC32_COMBO) && - (hLBox = COMBO_GetLBWindow(wnd->parent))) { + /******************************************************************** + * This if statement used to check to see if the parent of the + * edit control was a 'combobox' by comparing the ATOM of the parent + * to a table of internal window control ATOMs. However, this check + * would fail if the parent was a superclassed combobox (Although + * having the same basic functionality of a combobox, it has a + * different name and ATOM, thus defeating this check.) + * + * The safe way to determine if the parent is a combobox is to send it + * a message only a combo box would understand. I send it a message + * CB_GETCOUNT, if I get 0 then the parent is not a combobox - + * return FALSE. If I get > 0, then the parent IS a combobox + * (or sub/super classed derrivative thereof) + ********************************************************************/ + if ( + ((SendMessageA(wnd->parent->hwndSelf, CB_GETCOUNT, 0, 0)) > 0) && + (hLBox = COMBO_GetLBWindow(wnd->parent)) + ) + { HWND hCombo = wnd->parent->hwndSelf; BOOL bUIFlip = TRUE; -- 2.11.4.GIT