Module: wine
Branch: master
Commit: 5d5e84a0d803a3657aac4cffd5b7598347468a9a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5d5e84a0d803a3657aac4cff…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
Date: Fri Sep 28 14:44:07 2018 +0300
shell32/autocomplete: Hide the auto-suggest listbox when ESC is pressed.
When the listbox is visible, ESC should hide it. Only when it's not visible
should it be forwarded to the edit control. This matches Windows behavior.
Signed-off-…
[View More]by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/shell32/autocomplete.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c
index 5a2ebb7..3646e40 100644
--- a/dlls/shell32/autocomplete.c
+++ b/dlls/shell32/autocomplete.c
@@ -346,6 +346,15 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT
{
switch (wParam)
{
+ case VK_ESCAPE:
+ /* When pressing ESC, Windows hides the auto-suggest listbox, if visible */
+ if ((ac->options & ACO_AUTOSUGGEST) && IsWindowVisible(ac->hwndListBox))
+ {
+ ShowWindow(ac->hwndListBox, SW_HIDE);
+ ac->no_fwd_char = 0x1B; /* ESC char */
+ return 0;
+ }
+ break;
case VK_RETURN:
/* If quickComplete is set and control is pressed, replace the string */
if (ac->quickComplete && (GetKeyState(VK_CONTROL) & 0x8000))
[View Less]