diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-11 07:08:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-11 07:08:40 +0000 |
commit | bd820972afe24409e6b570adbc45f5dc0fa2385d (patch) | |
tree | e600bf39409083219c7928e10ec2b61002529641 /plugins/UserInfoEx/src | |
parent | 6029165c364f93a84ab7e98ef71d3a711b0f588c (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 'plugins/UserInfoEx/src')
-rw-r--r-- | plugins/UserInfoEx/src/Flags/svc_flags.cpp | 18 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/init.cpp | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index 75cdf0f5cf..19375c7fb7 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -329,6 +329,12 @@ MsgWndData::MsgWndData(HWND hwnd, HANDLE hContact) { m_hwnd = hwnd;
m_hContact = hContact;
m_countryID = (int)ServiceDetectContactOriginCountry((WPARAM)m_hContact,0);
+
+ StatusIconData sid = { sizeof(sid) };
+ sid.szModule = MODNAMEFLAGS;
+ sid.flags = MBF_HIDDEN;
+ Srmm_AddIcon(&sid);
+
FlagsIconUpdate();
}
@@ -344,8 +350,7 @@ void MsgWndData::FlagsIconSet() sid.szModule = MODNAMEFLAGS;
sid.hIconDisabled = sid.hIcon = LoadFlagIcon(m_countryID);
sid.szTooltip = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,m_countryID,0));
- if(CallService(MS_MSG_MODIFYICON,(WPARAM)m_hContact,(LPARAM)&sid) !=0) /* not yet registered? */
- CallService(MS_MSG_ADDICON,0,(LPARAM)&sid);
+ CallService(MS_MSG_MODIFYICON, (WPARAM)m_hContact, (LPARAM)&sid);
}
}
@@ -369,7 +374,8 @@ static int CompareIconListData(const IconList* p1, const IconList* p2) }
static OBJLIST<IconList> gIListMW(10, CompareIconListData);
-IconList::IconList(StatusIconData *sid) {
+IconList::IconList(StatusIconData *sid)
+{
m_StatusIconData.cbSize = sid->cbSize;
m_StatusIconData.szModule = mir_strdup(sid->szModule);
m_StatusIconData.dwId = sid->dwId;
@@ -379,13 +385,15 @@ IconList::IconList(StatusIconData *sid) { m_StatusIconData.szTooltip = mir_strdup(sid->szTooltip);
m_ID = sid->dwId;
- CallService(MS_MSG_ADDICON,0,(LPARAM)sid);
+ Srmm_AddIcon(sid);
}
-IconList::~IconList() {
+IconList::~IconList()
+{
mir_free(m_StatusIconData.szModule);
mir_free(m_StatusIconData.szTooltip);
}
+
// const char *pszName; // [Optional] Name of an icon registered with icolib to be used in GUI.
static __inline int MessageAPI_AddIcon(const char* pszName, const char* szModul/*StatusIconData *sid*/,int ID, int flags, const char* szTooltip)
{
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp index cc4e12f945..d353c585a8 100644 --- a/plugins/UserInfoEx/src/init.cpp +++ b/plugins/UserInfoEx/src/init.cpp @@ -70,7 +70,7 @@ static int OnTopToolBarLoaded(WPARAM wParam, LPARAM lParam) static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
myGlobals.PopUpActionsExist = ServiceExists(MS_POPUP_REGISTERACTIONS);
- myGlobals.MsgAddIconExist = ServiceExists(MS_MSG_ADDICON);
+ myGlobals.MsgAddIconExist = ServiceExists(MS_MSG_MODIFYICON);
// init meta contacts
INT_PTR ptr = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
|