summaryrefslogtreecommitdiff
path: root/plugins/YAMN/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
commitc4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch)
tree17a8627550b202d62df8e1df76d2585d3d0cdeaa /plugins/YAMN/src/main.cpp
parent5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (diff)
new easy standard way of registering icons: Icon_Register
git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAMN/src/main.cpp')
-rw-r--r--plugins/YAMN/src/main.cpp36
1 files changed, 7 insertions, 29 deletions
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index b935f2134f..c2083ab9f7 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -241,46 +241,24 @@ int SystemModulesLoaded(WPARAM, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
-struct TIconListItem
+static IconItem iconList[] =
{
- char* szDescr;
- char* szName;
- int defIconID;
- HANDLE hIcon;
-};
-
-static TIconListItem iconList[] =
-{
-
- { LPGEN("Check mail"), "YAMN_Check", IDI_CHECKMAIL, 0 },
- { LPGEN("Launch application"), "YAMN_Launch", IDI_LAUNCHAPP, 0 },
- { LPGEN("New Mail"), "YAMN_NewMail", IDI_NEWMAIL, 0 },
- { LPGEN("Connect Fail"), "YAMN_ConnectFail", IDI_BADCONNECT, 0 },
+ { LPGEN("Check mail"), "YAMN_Check", IDI_CHECKMAIL },
+ { LPGEN("Launch application"), "YAMN_Launch", IDI_LAUNCHAPP },
+ { LPGEN("New Mail"), "YAMN_NewMail", IDI_NEWMAIL },
+ { LPGEN("Connect Fail"), "YAMN_ConnectFail", IDI_BADCONNECT },
};
static void LoadIcons()
{
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(YAMNVar.hInst, szFile, MAX_PATH);
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.flags = SIDF_PATH_TCHAR;
- sid.ptszDefaultFile = szFile;
- sid.pszSection = "YAMN";
-
- for (int i = 0, k = 0; i < SIZEOF(iconList); i++) {
- sid.pszName = iconList[i].szName;
- sid.pszDescription = iconList[i].szDescr;
- sid.iDefaultIndex = -iconList[i].defIconID;
- iconList[i].hIcon = Skin_AddIcon(&sid);
- }
+ Icon_Register(YAMNVar.hInst, "YAMN", iconList, SIZEOF(iconList));
}
HANDLE WINAPI g_GetIconHandle( int idx )
{
if ( idx >= SIZEOF(iconList))
return NULL;
- return iconList[idx].hIcon;
+ return iconList[idx].hIcolib;
}
HICON WINAPI g_LoadIconEx( int idx, bool big )