summaryrefslogtreecommitdiff
path: root/plugins/NoHistory/src/icons.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NoHistory/src/icons.cpp')
-rw-r--r--plugins/NoHistory/src/icons.cpp46
1 files changed, 13 insertions, 33 deletions
diff --git a/plugins/NoHistory/src/icons.cpp b/plugins/NoHistory/src/icons.cpp
index f0d0844aa5..f823517f11 100644
--- a/plugins/NoHistory/src/icons.cpp
+++ b/plugins/NoHistory/src/icons.cpp
@@ -3,47 +3,27 @@
#include "resource.h"
HICON hIconRemove, hIconKeep, hIconClear;
-HANDLE hIcoLibIconsChanged = 0;
-int ReloadIcons(WPARAM wParam, LPARAM lParam) {
- hIconRemove = Skin_GetIcon(MODULE "_remove");
- hIconKeep = Skin_GetIcon(MODULE "_keep");
- hIconClear = Skin_GetIcon(MODULE "_clear");
+static IconItem iconList[] =
+{
+ { LPGEN("Disable"), "remove", IDI_HREMOVE },
+ { LPGEN("Enable"), "keep", IDI_HKEEP },
+ { LPGEN("Clear"), "clear", IDI_HCLEAR },
+};
+int ReloadIcons(WPARAM wParam, LPARAM lParam)
+{
+ hIconRemove = Skin_GetIconByHandle(iconList[0].hIcolib);
+ hIconKeep = Skin_GetIconByHandle(iconList[1].hIcolib);
+ hIconClear = Skin_GetIconByHandle(iconList[2].hIcolib);
return 0;
}
void InitIcons()
{
- TCHAR path[MAX_PATH];
- GetModuleFileName(hInst,path,MAX_PATH);
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.pszSection = MODULE;
- sid.flags = SIDF_PATH_TCHAR;
- sid.ptszDefaultFile = path;
-
- sid.pszDescription = LPGEN("Disable");
- sid.pszName = MODULE "_remove";
- sid.iDefaultIndex = -IDI_HREMOVE;
- Skin_AddIcon(&sid);
-
- sid.pszDescription = LPGEN("Enable");
- sid.pszName = MODULE "_keep";
- sid.iDefaultIndex = -IDI_HKEEP;
- Skin_AddIcon(&sid);
-
- sid.pszDescription = LPGEN("Clear");
- sid.pszName = MODULE "_clear";
- sid.iDefaultIndex = -IDI_HCLEAR;
- Skin_AddIcon(&sid);
+ Icon_Register(hInst, MODULE, iconList, SIZEOF(iconList), MODULE);
ReloadIcons(0, 0);
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
-}
-
-void DeinitIcons() {
- if(hIcoLibIconsChanged)
- UnhookEvent(hIcoLibIconsChanged);
+ HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
}