shell32/autocomplete: Use the same font for the AutoComplete listbox as the edit control.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2018-09-27 00:35:21 +03:00 committed by Alexandre Julliard
parent e11c3ddd59
commit d8de5fe47d
1 changed files with 11 additions and 0 deletions

View File

@ -384,6 +384,10 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
ret = CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam); ret = CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam);
autocomplete_text(This, hwnd, autoappend_flag_yes); autocomplete_text(This, hwnd, autoappend_flag_yes);
return ret; return ret;
case WM_SETFONT:
if (This->hwndListBox)
SendMessageW(This->hwndListBox, WM_SETFONT, wParam, lParam);
break;
case WM_DESTROY: case WM_DESTROY:
{ {
WNDPROC proc = This->wpOrigEditProc; WNDPROC proc = This->wpOrigEditProc;
@ -434,9 +438,16 @@ static void create_listbox(IAutoCompleteImpl *This)
0, 0, 0, 0, GetParent(This->hwndEdit), NULL, shell32_hInstance, NULL); 0, 0, 0, 0, GetParent(This->hwndEdit), NULL, shell32_hInstance, NULL);
if (This->hwndListBox) { if (This->hwndListBox) {
HFONT edit_font;
This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc); This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc);
SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This); SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This);
SetParent(This->hwndListBox, HWND_DESKTOP); SetParent(This->hwndListBox, HWND_DESKTOP);
/* Use the same font as the edit control, as it gets destroyed before it anyway */
edit_font = (HFONT)SendMessageW(This->hwndEdit, WM_GETFONT, 0, 0);
if (edit_font)
SendMessageW(This->hwndListBox, WM_SETFONT, (WPARAM)edit_font, FALSE);
} }
else else
This->options &= ~ACO_AUTOSUGGEST; This->options &= ~ACO_AUTOSUGGEST;