Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/shell32/autocomplete.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index a6404ca..8437d2d 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -24,8 +24,6 @@ - implement ACO_SEARCH style - implement ACO_FILTERPREFIXES style - implement ACO_RTLREADING style - - implement ResetEnumerator - */ #include "config.h"
@@ -1041,9 +1039,15 @@ static HRESULT WINAPI IAutoCompleteDropDown_fnResetEnumerator( { IAutoCompleteImpl *This = impl_from_IAutoCompleteDropDown(iface);
- FIXME("(%p): stub\n", This); + TRACE("(%p)\n", This);
- return E_NOTIMPL; + if (This->initialized) + { + free_enum_strs(This); + if ((This->options & ACO_AUTOSUGGEST) && IsWindowVisible(This->hwndListBox)) + autocomplete_text(This, This->hwndEdit, autoappend_flag_displayempty); + } + return S_OK; }
/**************************************************************************
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/shell32/tests/autocomplete.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/shell32/tests/autocomplete.c b/dlls/shell32/tests/autocomplete.c index 8265bf9..6921202 100644 --- a/dlls/shell32/tests/autocomplete.c +++ b/dlls/shell32/tests/autocomplete.c @@ -514,6 +514,7 @@ static void test_custom_source(void) struct string_enumerator *obj; IUnknown *enumerator; IAutoComplete2 *autocomplete; + IAutoCompleteDropDown *acdropdown; HWND hwnd_edit; WCHAR buffer[20]; HRESULT hr; @@ -525,11 +526,16 @@ static void test_custom_source(void) hr = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, &IID_IAutoComplete2, (void**)&autocomplete); ok(hr == S_OK, "CoCreateInstance failed: %x\n", hr);
+ hr = IAutoComplete2_QueryInterface(autocomplete, &IID_IAutoCompleteDropDown, (LPVOID*)&acdropdown); + ok(hr == S_OK, "No IAutoCompleteDropDown interface: %x\n", hr); + string_enumerator_create((void**)&enumerator, suggestions, ARRAY_SIZE(suggestions)); obj = (struct string_enumerator*)enumerator;
hr = IAutoComplete2_SetOptions(autocomplete, ACO_AUTOSUGGEST | ACO_AUTOAPPEND); ok(hr == S_OK, "IAutoComplete2_SetOptions failed: %x\n", hr); + hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown); + ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr); hr = IAutoComplete2_Init(autocomplete, hwnd_edit, enumerator, NULL, NULL); ok(hr == S_OK, "IAutoComplete_Init failed: %x\n", hr);
@@ -546,6 +552,9 @@ static void test_custom_source(void) SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer); ok(buffer[0] == '\0', "Expected empty string, got %s\n", wine_dbgstr_w(buffer)); ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets); + hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown); + ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr); + ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets); obj->num_resets = 0;
/* hijack the window procedure */ @@ -565,6 +574,8 @@ static void test_custom_source(void) dispatch_messages(); SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer); ok(buffer[0] == '\0', "Expected empty string, got %s\n", wine_dbgstr_w(buffer)); + hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown); + ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr);
HijackerWndProc_prev = (WNDPROC)SetWindowLongPtrW(hwnd_edit, GWLP_WNDPROC, (LONG_PTR)HijackerWndProc2); SendMessageW(hwnd_edit, WM_CHAR, 'a', 1); @@ -577,6 +588,17 @@ static void test_custom_source(void) /* end of hijacks */
test_aclist_expand(hwnd_edit, enumerator); + obj->num_resets = 0; + + hr = IAutoCompleteDropDown_ResetEnumerator(acdropdown); + ok(hr == S_OK, "IAutoCompleteDropDown_ResetEnumerator failed: %x\n", hr); + SendMessageW(hwnd_edit, WM_CHAR, 'x', 1); + dispatch_messages(); + ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets); + SendMessageW(hwnd_edit, WM_CHAR, 'x', 1); + dispatch_messages(); + ok(obj->num_resets == 1, "Expected 1 reset, got %u\n", obj->num_resets); + IAutoCompleteDropDown_Release(acdropdown);
ShowWindow(hMainWnd, SW_HIDE); DestroyWindow(hwnd_edit);
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- include/shldisp.idl | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/shldisp.idl b/include/shldisp.idl index f5372c4..19f2d73 100644 --- a/include/shldisp.idl +++ b/include/shldisp.idl @@ -99,6 +99,8 @@ interface IAutoComplete2 : IAutoComplete ACO_USETAB = 0x10, /* use tab to select autosuggest entries */ ACO_UPDOWNKEYDROPSLIST = 0x20, /* up/down arrow key invokes autosuggest dropdown (if enabled) */ ACO_RTLREADING = 0x40, /* enable RTL reading order for dropdown */ + ACO_WORD_FILTER = 0x80, /* treat the autocompleted suggestion as a phrase for search purposes */ + ACO_NOPREFIXFILTERING = 0x100, /* always display all suggestions */ } AUTOCOMPLETEOPTIONS;
HRESULT SetOptions( [in] DWORD dwFlag);
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/shell32/autocomplete.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 8437d2d..22fc62c 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -24,6 +24,7 @@ - implement ACO_SEARCH style - implement ACO_FILTERPREFIXES style - implement ACO_RTLREADING style + - implement ACO_WORD_FILTER style */ #include "config.h"
@@ -406,7 +407,8 @@ static BOOL display_matching_strs(IAutoCompleteImpl *ac, WCHAR *text, UINT len, UINT cnt, start, end; if (!str) return (ac->options & ACO_AUTOSUGGEST) ? FALSE : TRUE;
- if (len) + /* Windows seems to disable autoappend if ACO_NOPREFIXFILTERING is set */ + if (!(ac->options & ACO_NOPREFIXFILTERING) && len) { start = find_matching_enum_str(ac, 0, text, len, -1); if (start == ~0) @@ -811,6 +813,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit( if (This->options & ACO_SEARCH) FIXME(" ACO_SEARCH not supported\n"); if (This->options & ACO_FILTERPREFIXES) FIXME(" ACO_FILTERPREFIXES not supported\n"); if (This->options & ACO_RTLREADING) FIXME(" ACO_RTLREADING not supported\n"); + if (This->options & ACO_WORD_FILTER) FIXME(" ACO_WORD_FILTER not supported\n");
if (!hwndEdit || !punkACL) return E_INVALIDARG;
Signed-off-by: Huw Davies huw@codeweavers.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/shell32/autocomplete.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 22fc62c..705b28b 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -637,6 +637,10 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, ret = CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam); autocomplete_text(This, hwnd, autoappend_flag_yes); return ret; + case WM_MOUSEWHEEL: + if ((This->options & ACO_AUTOSUGGEST) && IsWindowVisible(This->hwndListBox)) + return SendMessageW(This->hwndListBox, WM_MOUSEWHEEL, wParam, lParam); + break; case WM_SETFONT: if (This->hwndListBox) SendMessageW(This->hwndListBox, WM_SETFONT, wParam, lParam);
Signed-off-by: Huw Davies huw@codeweavers.com