[PATCH v2 2/4] shell32/autocomplete: Don't reset the enumerator when losing focus if the edit control is still visible

Gabriel Ivăncescu gabrielopcode at gmail.com
Wed Oct 24 13:49:47 CDT 2018


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 dlls/shell32/autocomplete.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c
index 751bda0..0391f14 100644
--- a/dlls/shell32/autocomplete.c
+++ b/dlls/shell32/autocomplete.c
@@ -665,10 +665,15 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
                 hide_listbox(This, This->hwndListBox);
             return 0;
         case WM_KILLFOCUS:
-            if ((This->options & ACO_AUTOSUGGEST) && ((HWND)wParam != This->hwndListBox))
+            if (This->options & ACO_AUTOSUGGEST)
             {
-                hide_listbox(This, This->hwndListBox);
+                if ((HWND)wParam == This->hwndListBox) break;
+                ShowWindow(This->hwndListBox, SW_HIDE);
+                SendMessageW(This->hwndListBox, LB_RESETCONTENT, 0, 0);
             }
+
+            /* Reset the enumerator if it's not visible anymore */
+            if (!IsWindowVisible(hwnd)) free_enum_strs(This);
             break;
         case WM_KEYDOWN:
             return ACEditSubclassProc_KeyDown(This, hwnd, uMsg, wParam, lParam);
-- 
1.9.1




More information about the wine-devel mailing list