Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
This matches Windows behavior (see tests).
dlls/shell32/autocomplete.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 705b28b..6d8988b 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -627,6 +627,9 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, ? autoappend_flag_yes : autoappend_flag_no); return ret; case WM_SETTEXT: + if (This->options & ACO_AUTOSUGGEST) + hide_listbox(This, This->hwndListBox, TRUE); + break; case WM_CUT: case WM_CLEAR: case WM_UNDO:
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
It should hide the listbox, if visible.
dlls/shell32/tests/autocomplete.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/shell32/tests/autocomplete.c b/dlls/shell32/tests/autocomplete.c index 6921202..ad7eb6a 100644 --- a/dlls/shell32/tests/autocomplete.c +++ b/dlls/shell32/tests/autocomplete.c @@ -510,12 +510,14 @@ static void test_custom_source(void) static WCHAR str_alpha2[] = {'t','e','s','t','2',0}; static WCHAR str_beta[] = {'a','u','t','o',' ','c','o','m','p','l','e','t','e',0}; static WCHAR str_au[] = {'a','u',0}; + static WCHAR str_aut[] = {'a','u','t',0}; static WCHAR *suggestions[] = { str_alpha, str_alpha2, str_beta }; struct string_enumerator *obj; IUnknown *enumerator; IAutoComplete2 *autocomplete; IAutoCompleteDropDown *acdropdown; HWND hwnd_edit; + DWORD flags = 0; WCHAR buffer[20]; HRESULT hr;
@@ -587,6 +589,22 @@ static void test_custom_source(void) ok(obj->num_resets == 2, "Expected 2 resets, got %u\n", obj->num_resets); /* end of hijacks */
+ hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL); + ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr); + ok(flags & ACDD_VISIBLE, "AutoComplete DropDown should be visible\n"); + SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str_au); + dispatch_messages(); + hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL); + ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr); + ok(!(flags & ACDD_VISIBLE), "AutoComplete DropDown should have been hidden\n"); + SendMessageW(hwnd_edit, WM_SETTEXT, 0, (LPARAM)str_aut); + dispatch_messages(); + hr = IAutoCompleteDropDown_GetDropDownStatus(acdropdown, &flags, NULL); + ok(hr == S_OK, "IAutoCompleteDropDown_GetDropDownStatus failed: %x\n", hr); + ok(!(flags & ACDD_VISIBLE), "AutoComplete DropDown should be hidden\n"); + SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer); + ok(lstrcmpW(str_aut, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str_aut), wine_dbgstr_w(buffer)); + test_aclist_expand(hwnd_edit, enumerator); obj->num_resets = 0;
Signed-off-by: Huw Davies huw@codeweavers.com