summaryrefslogtreecommitdiff
path: root/plugins/Utils
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-10 14:46:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-10 14:46:58 +0000
commit101ca36412b3e7b8851b6b48a4f6cbc17d9f9eff (patch)
treea846c60f7c2a7df17b694deba92e7f6df3bbb882 /plugins/Utils
parenta3fdadd09f12f6b246b11a5156bf6f0358e9a5f8 (diff)
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
Diffstat (limited to 'plugins/Utils')
-rw-r--r--plugins/Utils/mir_icons.cpp15
-rw-r--r--plugins/Utils/mir_icons.h8
2 files changed, 8 insertions, 15 deletions
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 <Windows.h>
#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 <windows.h>
-
-
-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__