From 101ca36412b3e7b8851b6b48a4f6cbc17d9f9eff Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 10 Jun 2012 14:46:58 +0000 Subject: bitmap operations were removed from TopToolBar and replaced with IcoLib git-svn-id: http://svn.miranda-ng.org/main/trunk@379 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Utils/mir_icons.cpp | 15 +++++++-------- plugins/Utils/mir_icons.h | 8 +------- 2 files changed, 8 insertions(+), 15 deletions(-) (limited to 'plugins/Utils') diff --git a/plugins/Utils/mir_icons.cpp b/plugins/Utils/mir_icons.cpp index 1fb2c0ef82..bab0674d35 100644 --- a/plugins/Utils/mir_icons.cpp +++ b/plugins/Utils/mir_icons.cpp @@ -17,6 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include "mir_icons.h" @@ -26,8 +27,6 @@ Boston, MA 02111-1307, USA. extern HINSTANCE hInst; - - HICON IcoLib_LoadIcon(const char *iconName, BOOL copy) { if (!ServiceExists(MS_SKIN2_GETICON)) @@ -59,13 +58,12 @@ void IcoLib_ReleaseIcon(HICON hIcon) } -void IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id) +HANDLE IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id) { HICON hIcon = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) name); - if (hIcon != NULL) - { + if (hIcon != NULL) { CallService(MS_SKIN2_RELEASEICON, (WPARAM) hIcon, 0); - return; + return NULL; } SKINICONDESC sid = {0}; @@ -77,10 +75,11 @@ void IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id) int cx = GetSystemMetrics(SM_CXSMICON); sid.hDefaultIcon = (HICON) LoadImage(hInst, MAKEINTRESOURCE(id), IMAGE_ICON, cx, cx, LR_DEFAULTCOLOR | LR_SHARED); - - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + HANDLE hRes = Skin_AddIcon(&sid); if (sid.hDefaultIcon) DestroyIcon(sid.hDefaultIcon); + + return hRes; } diff --git a/plugins/Utils/mir_icons.h b/plugins/Utils/mir_icons.h index 178094c803..e1e1a918a3 100644 --- a/plugins/Utils/mir_icons.h +++ b/plugins/Utils/mir_icons.h @@ -23,16 +23,10 @@ Boston, MA 02111-1307, USA. #define _CRT_SECURE_NO_WARNINGS -#include - - -void IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id); +HANDLE IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id); HICON IcoLib_LoadIcon(const char *iconName, BOOL copy = FALSE); void IcoLib_ReleaseIcon(const char *iconName); void IcoLib_ReleaseIcon(HICON hIcon); - - - #endif // __MIR_ICONS_H__ -- cgit v1.2.3