以下是 IImageList2 接口的定义:
#undef INTERFACE
#define INTERFACE IImageList2
DECLARE_INTERFACE_(IImageList2, IImageList)
{
// IImageList methods
STDMETHOD(QueryInterface)(THIS_ REFIID, void **) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD(ImageList_SetIconSize)(THIS_ int cx, int cy) PURE;
STDMETHOD(ImageList_GetIconSize)(THIS_ int *cx, int *cy) PURE;
STDMETHOD(ImageList_SetImageCount)(THIS_ UINT uCount) PURE;
STDMETHOD(ImageList_GetImageCount)(THIS_ UINT *puCount) PURE;
STDMETHOD(ImageList_SetBkColor)(THIS_ COLORREF clrBk, COLORREF *pclr) PURE;
STDMETHOD(ImageList_GetBkColor)(THIS_ COLORREF *pclr) PURE;
STDMETHOD(ImageList_SetOverlayImage)(THIS_ int iImage, int iOverlay) PURE;
STDMETHOD(ImageList_ReplaceIcon)(THIS_ int i, HICON hicon, int *pi) PURE;
STDMETHOD(ImageList_Replace)(THIS_ int i, HBITMAP hbmImage, HBITMAP hbmMask) PURE;
STDMETHOD(ImageList_AddMasked)(THIS_ HBITMAP hbmImage, COLORREF crMask, int *pi) PURE;
STDMETHOD(ImageList_Draw)(THIS_ IMAGELISTDRAWPARAMS *pimldp) PURE;
STDMETHOD(ImageList_Remove)(THIS_ int i) PURE;
STDMETHOD(ImageList_GetIcon)(THIS_ int i, UINT flags, HICON *picon) PURE;
STDMETHOD(ImageList_GetImageInfo)(THIS_ int i, IMAGEINFO *pImageInfo) PURE;
STDMETHOD(ImageList_Copy)(THIS_ int iDst, IUnknown *punkSrc, int iSrc, UINT uFlags) PURE;
STDMETHOD(ImageList_Merge)(THIS_ int i1, IUnknown *punk2, int i2, int dx, int dy, REFIID riid, PVOID *ppv) PURE;
STDMETHOD(ImageList_Clone)(THIS_ REFIID riid, PVOID *ppv) PURE;
STDMETHOD(ImageList_GetImageRect)(THIS_ int i, RECT *prc) PURE;
STDMETHOD(ImageList_GetIconSize)(THIS_ int *cx, int *cy) PURE;
STDMETHOD(ImageList_SetIconSize)(THIS_ int cx, int cy) PURE;
STDMETHOD(ImageList_GetImageCount)(THIS_ int *pi) PURE;
STDMETHOD(ImageList_SetImageCount)(THIS_ UINT uNewCount) PURE;
STDMETHOD(ImageList_SetBkColor)(THIS_ COLORREF clrBk, COLORREF *pclr) PURE;
STDMETHOD(ImageList_GetBkColor)(THIS_ COLORREF *pclr) PURE;
STDMETHOD(ImageList_BeginDrag)(THIS_ int iTrack, int dxHotspot, int dyHotspot) PURE;
STDMETHOD(ImageList_EndDrag)(THIS) PURE;
STDMETHOD(ImageList_DragEnter)(THIS_ HWND hwndLock, int x, int y) PURE;
STDMETHOD(ImageList_DragLeave)(THIS_ HWND hwndLock) PURE;
STDMETHOD(ImageList_DragMove)(THIS_ int x, int y) PURE;
STDMETHOD(ImageList_SetDragCursorImage)(THIS_ IUnknown *punk, int iDrag, int dxHotspot, int dyHotspot) PURE;
STDMETHOD(ImageList_DragShowNolock)(THIS_ BOOL fShow) PURE;
STDMETHOD(GetDragImage)(THIS_ POINT *ppt, POINT *pptHotspot, REFIID riid, PVOID *ppv) PURE;
STDMETHOD(GetItemFlags)(THIS_ int i, DWORD *dwFlags) PURE;
STDMETHOD(GetOverlayImage)(THIS_ int iOverlay, int *piIndex) PURE;
// IImageList2 methods
STDMETHOD(Resize)(THIS_ SIZE size) PURE;
STDMETHOD(GetOriginalSize)(THIS_ int iImage, DWORD dwFlags, SIZE *psize) PURE;
STDMETHOD(SetOriginalSize)(THIS_ int iImage, DWORD dwFlags, int cx, int cy) PURE;
STDMETHOD(SetCallback)(THIS_ IUnknown *punk) PURE;
STDMETHOD(GetCallback)(THIS_ REFIID riid, PVOID *ppv) PURE;
STDMETHOD(FaultInIEFeature)(THIS_ HWND hwnd, uCLSSPEC *pclsid, QUERYCONTEXT *pqc) PURE;
};
IImageList2 接口包括了 IImageList 的所有方法,并添加了一些额外的方法,例如 Resize 用于调整图像列表的大小,以及一些与回调相关的方法。这个接口提供了更多的灵活性和功能,适用于需要更先进图像列表功能的应用程序。
转载请注明出处:http://www.zyzy.cn/article/detail/25044/Win32 API/Commoncontrols.h/IImageList2