[PATCH v2 3/8] shell32/autocomplete: Use the same font for the AutoComplete listbox as the edit control

Huw Davies huw at codeweavers.com
Wed Sep 26 06:37:20 CDT 2018


On Tue, Sep 25, 2018 at 02:55:29PM +0300, Gabriel Ivăncescu wrote:
> Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
> ---
> 
> This looks much nicer and less out of place.
> 
>  dlls/shell32/autocomplete.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c
> index fe5bba2..a681655 100644
> --- a/dlls/shell32/autocomplete.c
> +++ b/dlls/shell32/autocomplete.c
> @@ -384,6 +384,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_SETFONT:
> +            if (This->hwndListBox)
> +                SendMessageW(This->hwndListBox, WM_SETFONT, wParam, lParam);
> +            break;
>          case WM_DESTROY:
>          {
>              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);
>  
>      if (This->hwndListBox) {
> +        HFONT edit_font;
> +
>          This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc);
>          SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This);
>          SetParent(This->hwndListBox, HWND_DESKTOP);
> +
> +        /* Use the same font as the edit control, as it gets destroyed before it anyway */
> +        edit_font = (HFONT)CallWindowProcW(This->wpOrigEditProc, This->hwndEdit, WM_GETFONT, 0, 0);

Is there any reason you can't use SendMessage here?

> +        if (edit_font)
> +            SendMessageW(This->hwndListBox, WM_SETFONT, (WPARAM)edit_font, FALSE);
>      }



More information about the wine-devel mailing list