[PATCH 1/2] comctl32: If STM_SETIMAGE failed to assign the image don't repaint the control.

Alexandre Julliard julliard at winehq.org
Tue Aug 17 13:31:29 CDT 2021


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
> ---
>  dlls/comctl32/static.c       |  6 ++++--
>  dlls/comctl32/tests/static.c | 17 +++++++++++++++++
>  2 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c
> index 2bd2b22bc20..554e75aa194 100644
> --- a/dlls/comctl32/static.c
> +++ b/dlls/comctl32/static.c
> @@ -607,12 +607,14 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
>              FIXME("STM_SETIMAGE: Unhandled type %lx\n", wParam);
>              break;
>          }
> -        STATIC_TryPaintFcn( hwnd, full_style );
> +        if (lResult)
> +            STATIC_TryPaintFcn( hwnd, full_style );
>          break;
>  
>      case STM_SETICON:
>          lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)wParam, full_style );
> -        STATIC_TryPaintFcn( hwnd, full_style );
> +        if (lResult)
> +            STATIC_TryPaintFcn( hwnd, full_style );
>          break;

I expect you'd still want to repaint if the old image was 0. This would
need more tests for the various possible failure cases.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list