From fee3a74e7429552ebbfe7ae9c14a4f6c25156fb6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 13 Apr 2019 00:11:59 +0300 Subject: CMPluginBase::addImgListIcon: new helper to safely add an icolib icon to HIMAGELIST --- include/m_icolib.h | 6 ++++++ include/newpluginapi.h | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'include') diff --git a/include/m_icolib.h b/include/m_icolib.h index b63fc4abf0..e8a0ec3704 100644 --- a/include/m_icolib.h +++ b/include/m_icolib.h @@ -110,6 +110,12 @@ MIR_APP_DLL(void) Window_SetSkinIcon_IcoLib(HWND hWnd, int iconId); MIR_APP_DLL(void) Window_SetProtoIcon_IcoLib(HWND hWnd, const char *szProto, int iconId); MIR_APP_DLL(void) Window_FreeIcon_IcoLib(HWND hWnd); +/////////////////////////////////////////////////////////////////////////////// +// Helper to add an icolib's icon to a HIMAGELIST + +MIR_APP_DLL(int) ImageList_AddSkinIcon(HIMAGELIST hIml, int iconId); +MIR_APP_DLL(int) ImageList_AddProtoIcon(HIMAGELIST hIml, const char *szProto, int iconId); + /////////////////////////////////////////////////////////////////////////////// // Icons' change notification event diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 6be344e66c..153da7936e 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -25,6 +25,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_NEWPLUGINAPI_H__ #define M_NEWPLUGINAPI_H__ +#if !defined(HIMAGELIST) +typedef struct _IMAGELIST* HIMAGELIST; +#endif + #include #include @@ -176,6 +180,7 @@ public: void debugLogW(LPCWSTR wszFormat, ...); __forceinline void addIcolib(HANDLE hIcolib) { m_arIcons.insert((IcolibItem*)hIcolib); } + int addImgListIcon(HIMAGELIST himl, int iconId); HICON getIcon(int iconId, bool big = false); HANDLE getIconHandle(int iconId); void releaseIcon(int iconId, bool big = false); -- cgit v1.2.3