summaryrefslogtreecommitdiff
path: root/plugins/FavContacts/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-08 20:51:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-08 20:51:14 +0000
commit696f4ea57845f48d6d979ecd9d66bb22bd9f738d (patch)
treec32ac05d363bff47320c1b204561b966aa1c81fd /plugins/FavContacts/src/main.cpp
parent3b396a2da6b0b8e0f4d2c051aca133772d317820 (diff)
TopToolbar usage fixed everywhere
git-svn-id: http://svn.miranda-ng.org/main/trunk@861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FavContacts/src/main.cpp')
-rw-r--r--plugins/FavContacts/src/main.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index d1bfd4ee2a..7f844cbeb0 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -121,20 +121,16 @@ static __forceinline COLORREF sttShadeColor(COLORREF clLine1, COLORREF clBack)
);
}
-HANDLE hhkProcessTBLoaded = NULL;
int ProcessTBLoaded(WPARAM wParam, LPARAM lParam)
{
- TBButton button = {0};
+ TTBButton button = {0};
button.cbSize = sizeof(button);
- button.pszButtonID = "FavContacts/ShowMenu";
button.pszTooltipUp = button.pszTooltipUp =
- button.pszButtonName = "Favourite Contacts";
- button.pszServiceName = MS_FAVCONTACTS_SHOWMENU;
- button.defPos = 200;
- button.tbbFlags = TBBF_SHOWTOOLTIP|TBBF_VISIBLE;
- button.hSecondaryIconHandle = button.hPrimaryIconHandle = (HANDLE)g_icoFavourite;
- CallService(MS_TB_ADDBUTTON, 0, (LPARAM)&button);
-
+ button.name = LPGEN("Favourite Contacts");
+ button.pszService = MS_FAVCONTACTS_SHOWMENU;
+ button.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
+ button.hIconHandleDn = button.hIconHandleUp = (HANDLE)g_icoFavourite;
+ TopToolbar_AddButton(&button);
return 0;
}
@@ -177,6 +173,8 @@ int ProcessReloadFonts(WPARAM wParam, LPARAM lParam)
int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam)
{
+ HookEvent(ME_TTB_MODULELOADED, ProcessTBLoaded);
+
if (ServiceExists(MS_MSG_ADDICON)) {
StatusIconData sid = {0};
sid.cbSize = sizeof(sid);
@@ -263,16 +261,13 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam)
hotkey.DefHotKey = MAKEWORD('Q', HOTKEYF_EXT);
Hotkey_Register(&hotkey);
- if (ServiceExists(MS_AV_GETAVATARBITMAP))
- {
+ if (ServiceExists(MS_AV_GETAVATARBITMAP)) {
HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
if (DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0))
CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
}
- if (!hhkProcessTBLoaded) hhkProcessTBLoaded = HookEvent(ME_TB_MODULELOADED, ProcessTBLoaded);
-
return 0;
}
@@ -327,7 +322,6 @@ extern "C" __declspec(dllexport) int Load(void)
HookEvent(ME_OPT_INITIALISE, ProcessOptInitialise);
HookEvent(ME_SYSTEM_MODULESLOADED, ProcessModulesLoaded);
- hhkProcessTBLoaded = HookEvent(ME_TB_MODULELOADED, ProcessTBLoaded);
/////////////////////////////////////////////////////////////////////////////////////