From 75b1ff75c42644eb36552762652e4b0c9ff071bc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 2 Nov 2012 14:11:01 +0000 Subject: final switch to the typed icolib api git-svn-id: http://svn.miranda-ng.org/main/trunk@2152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/globals.cpp | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'plugins/Scriver/src/globals.cpp') diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 6e9a23b22b..113cf79437 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -118,37 +118,34 @@ BOOL IsStaticIcon(HICON hIcon) { } void ReleaseIconSmart(HICON hIcon) { - if (!IsStaticIcon(hIcon)) { - DWORD result = CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0); - if ( result == 1 || result == CALLSERVICE_NOTFOUND) - DestroyIcon(hIcon); - } + if (!IsStaticIcon(hIcon)) + Skin_ReleaseIcon(hIcon); } int ImageList_AddIcon_Ex(HIMAGELIST hIml, int id) { HICON hIcon = LoadSkinnedIcon(id); int res = ImageList_AddIcon(hIml, hIcon); - CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0); + Skin_ReleaseIcon(hIcon); return res; } int ImageList_AddIcon_Ex2(HIMAGELIST hIml, HICON hIcon) { int res = ImageList_AddIcon(hIml, hIcon); - CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0); + Skin_ReleaseIcon(hIcon); return res; } int ImageList_ReplaceIcon_Ex(HIMAGELIST hIml, int nIndex, int id) { HICON hIcon = LoadSkinnedIcon(id); int res = ImageList_ReplaceIcon(hIml, nIndex, hIcon); - CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0); + Skin_ReleaseIcon(hIcon); return res; } int ImageList_AddIcon_ProtoEx(HIMAGELIST hIml, const char* szProto, int status) { HICON hIcon = LoadSkinnedProtoIcon(szProto, status); int res = ImageList_AddIcon(hIml, hIcon); - CallService(MS_SKIN2_RELEASEICON,(WPARAM)hIcon, 0); + Skin_ReleaseIcon(hIcon); return res; } @@ -177,15 +174,13 @@ void RegisterIcons(void) void ReleaseIcons() { - int i; - for (i = 0; i < SIZEOF(hIconList); i++) { - if (hIconList[i] != NULL) { - CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIconList[i], 0); - } - } - CallService(MS_SKIN2_RELEASEICON, (WPARAM)g_dat->hMsgIcon, 0); - CallService(MS_SKIN2_RELEASEICON, (WPARAM)g_dat->hMsgIconBig, 0); - CallService(MS_SKIN2_RELEASEICON, (WPARAM)g_dat->hIconChatBig, 0); + for (int i = 0; i < SIZEOF(hIconList); i++) + if (hIconList[i] != NULL) + Skin_ReleaseIcon(hIconList[i]); + + Skin_ReleaseIcon(g_dat->hMsgIcon); + Skin_ReleaseIcon(g_dat->hMsgIconBig); + Skin_ReleaseIcon(g_dat->hIconChatBig); } HICON GetCachedIcon(const char *name) @@ -202,13 +197,12 @@ HICON GetCachedIcon(const char *name) void LoadGlobalIcons() { int i; int overlayIcon; - for (i = 0; i < SIZEOF(iconList); i++) { - hIconList[i] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)iconList[i].name); - } + for (i = 0; i < SIZEOF(iconList); i++) + hIconList[i] = Skin_GetIcon(iconList[i].name); g_dat->hMsgIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE); g_dat->hMsgIconBig = LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE); - g_dat->hIconChatBig = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"chat_window"); + g_dat->hIconChatBig = Skin_GetIcon("chat_window"); ImageList_RemoveAll(g_dat->hButtonIconList); ImageList_RemoveAll(g_dat->hChatButtonIconList); -- cgit v1.2.3