diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-01 20:32:13 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-01 20:32:13 +0000 |
commit | 1860018b201d995ed051c0affb72d5a1d09fa02e (patch) | |
tree | 1ee096c43578fdf5694e5487d672830f810f186c /plugins/SimpleStatusMsg | |
parent | 7300094417302d82aa4f3f6e469f91d8facf4f26 (diff) |
SKINICONDESC initialization - end of story
git-svn-id: http://svn.miranda-ng.org/main/trunk@2598 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SimpleStatusMsg')
-rw-r--r-- | plugins/SimpleStatusMsg/src/utils.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp index 013d8e5971..7c706e7818 100644 --- a/plugins/SimpleStatusMsg/src/utils.cpp +++ b/plugins/SimpleStatusMsg/src/utils.cpp @@ -27,13 +27,14 @@ static int HookCount = 0; static int ProtoHookCount = 0;
static int ServiceCount = 0;
-struct tagiconList
+struct
{
- const TCHAR *szDescr;
- const char *szName;
- int defIconID;
+ TCHAR *szDescr;
+ char *szName;
+ int defIconID;
+ HANDLE hIcolib;
}
-static const iconList[] =
+static iconList[] =
{
{ LPGENT("Delete Selected"), "cross", IDI_CROSS },
{ LPGENT("Recent Message"), "recent", IDI_HISTORY },
@@ -45,26 +46,22 @@ static const iconList[] = { LPGENT("Go to URL in Away Message"), "gotourl", IDI_GOTOURL }
};
-HANDLE hIconLibItem[SIZEOF(iconList)];
-
void IconsInit(void)
{
- SKINICONDESC sid = {0};
- char szFile[MAX_PATH];
- char szSettingName[100];
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(g_hInst, szFile, SIZEOF(szFile));
- GetModuleFileNameA(g_hInst, szFile, MAX_PATH);
- sid.cbSize = sizeof(SKINICONDESC);
- sid.flags = SIDF_TCHAR;
- sid.pszDefaultFile = szFile;
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.flags = SIDF_ALL_TCHAR;
+ sid.ptszDefaultFile = szFile;
sid.ptszSection = _T("Simple Status Message");
- for (int i = 0; i < SIZEOF(iconList); i++)
- {
+ for (int i = 0; i < SIZEOF(iconList); i++) {
+ char szSettingName[100];
mir_snprintf(szSettingName, SIZEOF(szSettingName), "SimpleStatusMsg_%s", iconList[i].szName);
sid.pszName = szSettingName;
sid.ptszDescription = (TCHAR*)iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = Skin_AddIcon(&sid);
+ iconList[i].hIcolib = Skin_AddIcon(&sid);
}
}
@@ -78,7 +75,9 @@ HICON LoadIconEx(const char* name) HANDLE GetIconHandle(int iconId)
{
for(int i = 0; i < SIZEOF(iconList); i++)
- if (iconList[i].defIconID == iconId) return hIconLibItem[i];
+ if (iconList[i].defIconID == iconId)
+ return iconList[i].hIcolib;
+
return NULL;
}
|