diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-02 18:19:49 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-02 18:19:49 +0000 |
commit | c4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch) | |
tree | 17a8627550b202d62df8e1df76d2585d3d0cdeaa /plugins/SmileyAdd/src/main.cpp | |
parent | 5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (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/SmileyAdd/src/main.cpp')
-rw-r--r-- | plugins/SmileyAdd/src/main.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index 61e4b2bbb8..723cad3473 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -58,18 +58,13 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /* mira // MirandaInterfaces - returns the protocol interface to the core
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_SMILEY, MIID_LAST};
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static IconItem icon = { LPGEN("Button Smiley"), "SmileyAdd_ButtonSmiley", IDI_SMILINGICON };
+
static int ModulesLoaded(WPARAM, LPARAM)
{
- char path[MAX_PATH];
- GetModuleFileNameA(g_hInst, path, MAX_PATH);
-
- SKINICONDESC sid = { sizeof(SKINICONDESC) };
- sid.pszName = "SmileyAdd_ButtonSmiley";
- sid.pszSection = "SmileyAdd";
- sid.pszDescription = LPGEN("Button Smiley");
- sid.pszDefaultFile = path;
- sid.iDefaultIndex = -IDI_SMILINGICON;
- HANDLE hSkinIcon = Skin_AddIcon(&sid);
+ Icon_Register(g_hInst, "SmileyAdd", &icon, 1);
INT_PTR temp = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
metaProtoName = mir_strdup(temp == CALLSERVICE_NOTFOUND ? NULL : (char*)temp);
@@ -78,7 +73,7 @@ static int ModulesLoaded(WPARAM, LPARAM) mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
mi.popupPosition = 2000070050;
mi.position = 2000070050;
- mi.icolibItem = hSkinIcon;
+ mi.icolibItem = icon.hIcolib;
mi.pszPopupName = (char*)-1;
mi.pszName = "Assign Smiley Category";
hContactMenuItem = Menu_AddContactMenuItem(&mi);
|