summaryrefslogtreecommitdiff
path: root/src/modules/srmm/statusicon.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-11 07:08:40 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-11 07:08:40 +0000
commitbd820972afe24409e6b570adbc45f5dc0fa2385d (patch)
treee600bf39409083219c7928e10ec2b61002529641 /src/modules/srmm/statusicon.cpp
parent6029165c364f93a84ab7e98ef71d3a711b0f588c (diff)
SRMM icons to be unloaded automatically
git-svn-id: http://svn.miranda-ng.org/main/trunk@4418 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/srmm/statusicon.cpp')
-rw-r--r--src/modules/srmm/statusicon.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/modules/srmm/statusicon.cpp b/src/modules/srmm/statusicon.cpp
index dcf055a88f..ca5f526fac 100644
--- a/src/modules/srmm/statusicon.cpp
+++ b/src/modules/srmm/statusicon.cpp
@@ -49,6 +49,8 @@ struct StatusIconMain : public MZeroedObject
}
StatusIconData sid;
+
+ int hPangpack;
OBJLIST<StatusIconChild> arChildren;
};
@@ -111,6 +113,7 @@ static INT_PTR AddStatusIcon(WPARAM wParam, LPARAM lParam)
p = new StatusIconMain;
memcpy(&p->sid, sid, sizeof(p->sid));
+ p->hPangpack = (int)wParam;
p->sid.szModule = mir_strdup(sid->szModule);
p->sid.szTooltip = mir_strdup(sid->szTooltip);
arIcons.insert(p);
@@ -185,9 +188,18 @@ static int OnModulesLoaded(WPARAM, LPARAM)
return 0;
}
+void KillModuleSrmmIcons(int hLangpack)
+{
+ for (int i=arIcons.getCount()-1; i >= 0; i--) {
+ StatusIconMain &p = arIcons[i];
+ if (p.hPangpack == hLangpack)
+ arIcons.remove(i);
+ }
+}
+
int LoadSrmmModule()
{
- CreateServiceFunction(MS_MSG_ADDICON, AddStatusIcon);
+ CreateServiceFunction("MessageAPI/AddIcon", AddStatusIcon);
CreateServiceFunction(MS_MSG_REMOVEICON, RemoveStatusIcon);
CreateServiceFunction(MS_MSG_MODIFYICON, ModifyStatusIcon);
CreateServiceFunction(MS_MSG_GETNTHICON, GetNthIcon);