Commit 8a4a7616 authored by Owen Rudge's avatar Owen Rudge Committed by Alexandre Julliard

comctl32: Implement SetOverlayImage, Replace, AddMasked, Draw, Remove, GetImageInfo.

parent a07c922f
...@@ -3021,29 +3021,54 @@ static HRESULT WINAPI ImageListImpl_ReplaceIcon(IImageList *iface, int i, ...@@ -3021,29 +3021,54 @@ static HRESULT WINAPI ImageListImpl_ReplaceIcon(IImageList *iface, int i,
static HRESULT WINAPI ImageListImpl_SetOverlayImage(IImageList *iface, static HRESULT WINAPI ImageListImpl_SetOverlayImage(IImageList *iface,
int iImage, int iOverlay) int iImage, int iOverlay)
{ {
FIXME("STUB: %p %d %d\n", iface, iImage, iOverlay); return ImageList_SetOverlayImage((HIMAGELIST) iface, iImage, iOverlay)
return E_NOTIMPL; ? S_OK : E_FAIL;
} }
static HRESULT WINAPI ImageListImpl_Replace(IImageList *iface, int i, static HRESULT WINAPI ImageListImpl_Replace(IImageList *iface, int i,
HBITMAP hbmImage, HBITMAP hbmMask) HBITMAP hbmImage, HBITMAP hbmMask)
{ {
FIXME("STUB: %p %d %p %p\n", iface, i, hbmImage, hbmMask); return ImageList_Replace((HIMAGELIST) iface, i, hbmImage, hbmMask) ? S_OK :
return E_NOTIMPL; E_FAIL;
} }
static HRESULT WINAPI ImageListImpl_AddMasked(IImageList *iface, HBITMAP hbmImage, static HRESULT WINAPI ImageListImpl_AddMasked(IImageList *iface, HBITMAP hbmImage,
COLORREF crMask, int *pi) COLORREF crMask, int *pi)
{ {
FIXME("STUB: %p %p %x %p\n", iface, hbmImage, crMask, pi); HIMAGELIST This = (HIMAGELIST) iface;
return E_NOTIMPL; int ret;
if (!pi)
return E_FAIL;
ret = ImageList_AddMasked(This, hbmImage, crMask);
if (ret == -1)
return E_FAIL;
*pi = ret;
return S_OK;
} }
static HRESULT WINAPI ImageListImpl_Draw(IImageList *iface, static HRESULT WINAPI ImageListImpl_Draw(IImageList *iface,
IMAGELISTDRAWPARAMS *pimldp) IMAGELISTDRAWPARAMS *pimldp)
{ {
FIXME("STUB: %p %p\n", iface, pimldp); HIMAGELIST This = (HIMAGELIST) iface;
return E_NOTIMPL; HIMAGELIST old_himl = 0;
int ret = 0;
if (!pimldp)
return E_FAIL;
/* As far as I can tell, Windows simply ignores the contents of pimldp->himl
so we shall simulate the same */
old_himl = pimldp->himl;
pimldp->himl = This;
ret = ImageList_DrawIndirect(pimldp);
pimldp->himl = old_himl;
return ret ? S_OK : E_FAIL;
} }
static HRESULT WINAPI ImageListImpl_Remove(IImageList *iface, int i) static HRESULT WINAPI ImageListImpl_Remove(IImageList *iface, int i)
...@@ -3054,15 +3079,24 @@ static HRESULT WINAPI ImageListImpl_Remove(IImageList *iface, int i) ...@@ -3054,15 +3079,24 @@ static HRESULT WINAPI ImageListImpl_Remove(IImageList *iface, int i)
static HRESULT WINAPI ImageListImpl_GetIcon(IImageList *iface, int i, UINT flags, static HRESULT WINAPI ImageListImpl_GetIcon(IImageList *iface, int i, UINT flags,
HICON *picon) HICON *picon)
{ {
FIXME("STUB: %p %d %x %p\n", iface, i, flags, picon); HICON hIcon;
return E_NOTIMPL;
if (!picon)
return E_FAIL;
hIcon = ImageList_GetIcon((HIMAGELIST) iface, i, flags);
if (hIcon == NULL)
return E_FAIL;
*picon = hIcon;
return S_OK;
} }
static HRESULT WINAPI ImageListImpl_GetImageInfo(IImageList *iface, int i, static HRESULT WINAPI ImageListImpl_GetImageInfo(IImageList *iface, int i,
IMAGEINFO *pImageInfo) IMAGEINFO *pImageInfo)
{ {
FIXME("STUB: %p %d %p\n", iface, i, pImageInfo); return ImageList_GetImageInfo((HIMAGELIST) iface, i, pImageInfo) ? S_OK : E_FAIL;
return E_NOTIMPL;
} }
static HRESULT WINAPI ImageListImpl_Copy(IImageList *iface, int iDst, static HRESULT WINAPI ImageListImpl_Copy(IImageList *iface, int iDst,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment