From 3dcd048175914e7b5c372b5dc201c517028f0f64 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 24 Aug 2018 16:04:09 +0800 Subject: [PATCH] oleaut32: Use common helper for masked bitmaps to render an icon. Signed-off-by: Dmitry Timoshkov Signed-off-by: Alexandre Julliard --- dlls/oleaut32/olepicture.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index aa82b057eea..0ef0ecfeb6d 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -711,9 +711,18 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, } case PICTYPE_ICON: - FIXME("Not quite correct implementation of rendering icons...\n"); - DrawIconEx(hdc, x, y, This->desc.u.icon.hicon, cx, cy, 0, NULL, DI_NORMAL); + { + ICONINFO info; + + if (!GetIconInfo(This->desc.u.icon.hicon, &info)) + return E_FAIL; + + render_masked_bitmap(This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, info.hbmMask, info.hbmColor); + + DeleteObject(info.hbmMask); + if (info.hbmColor) DeleteObject(info.hbmColor); break; + } case PICTYPE_METAFILE: {