diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index df6836c1989..a88c36e0a94 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -1405,14 +1405,19 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle) TRACE("%p %d %d\n", himl, i, fStyle); if (!is_valid(himl) || (i < 0) || (i >= himl->cCurImage)) return NULL; - hdcDst = CreateCompatibleDC(0); - ii.fIcon = TRUE; ii.xHotspot = 0; ii.yHotspot = 0; + /* create colour bitmap */ + hdcDst = GetDC(0); + ii.hbmColor = CreateCompatibleBitmap(hdcDst, himl->cx, himl->cy); + ReleaseDC(0, hdcDst); + + hdcDst = CreateCompatibleDC(0); + /* draw mask*/ - ii.hbmMask = CreateCompatibleBitmap (hdcDst, himl->cx, himl->cy); + ii.hbmMask = CreateBitmap (himl->cx, himl->cy, 1, 1, NULL); hOldDstBitmap = SelectObject (hdcDst, ii.hbmMask); if (himl->hbmMask) { BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, @@ -1422,7 +1427,6 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle) PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS); /* draw image*/ - ii.hbmColor = CreateCompatibleBitmap (himl->hdcImage, himl->cx, himl->cy); SelectObject (hdcDst, ii.hbmColor); BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, himl->hdcImage, i * himl->cx, 0, SRCCOPY);