diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-10 12:45:32 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-10 12:45:32 +0000 |
commit | 6ac63284a8f93f977db66673727d4995a86764c4 (patch) | |
tree | 79d7e0b6744e1de21e6c01c0b0869be8927621a1 /plugins/UserInfoEx | |
parent | 102a413497df49bd2af8ee0a1770718fa0ecfcc2 (diff) |
various TTB initialization issues
git-svn-id: http://svn.miranda-ng.org/main/trunk@3957 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx')
-rw-r--r-- | plugins/UserInfoEx/src/dlg_anniversarylist.cpp | 3 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/init.cpp | 23 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_reminder.cpp | 4 |
3 files changed, 9 insertions, 21 deletions
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 5db440fb3e..ba8414a843 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -1080,8 +1080,7 @@ INT_PTR DlgAnniversaryListShow(WPARAM wParam, LPARAM lParam) VOID DlgAnniversaryListOnTopToolBarLoaded()
{
- TTBButton ttb = {0};
- ttb.cbSize = sizeof(ttb);
+ TTBButton ttb = { sizeof(ttb) };
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_USERINFO_REMINDER_LIST;
ttb.hIconHandleUp = Skin_GetIconHandle(ICO_COMMON_ANNIVERSARY);
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp index 8890c9bd51..879d7df5b5 100644 --- a/plugins/UserInfoEx/src/init.cpp +++ b/plugins/UserInfoEx/src/init.cpp @@ -57,11 +57,6 @@ static PLUGININFOEX pluginInfo = { {0x9c23a24b, 0xe6aa, 0x43c6, {0xb0, 0xb8, 0xd6, 0xc3, 0x6d, 0x2f, 0x7b, 0x57}}
};
-static HANDLE ghModulesLoadedHook = NULL;
-static HANDLE ghTopToolBarLoaded = NULL;
-static HANDLE ghModernToolBarLoaded = NULL;
-static HANDLE ghShutdownHook = NULL;
-static HANDLE ghPrebuildStatusMenu = NULL;
int hLangpack;
/*
@@ -122,7 +117,7 @@ static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam) // build contact's menuitems
RebuildMenu();
- ghPrebuildStatusMenu = HookEvent( ME_CLIST_PREBUILDSTATUSMENU, (MIRANDAHOOK)RebuildAccount);
+ HookEvent( ME_CLIST_PREBUILDSTATUSMENU, (MIRANDAHOOK)RebuildAccount);
// install known modules strings to database
DB::Setting::WriteAString(NULL, "KnownModules", MODULELONGNAME, USERINFO","MODNAME","MOD_MBIRTHDAY","MODNAMEFLAGS);
@@ -132,7 +127,6 @@ static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam) static INT OnShutdown(WPARAM wParam, LPARAM lParam)
{
- UnhookEvent(ghShutdownHook);
DlgContactInfoUnLoadModule();
SvcReminderUnloadModule();
@@ -141,7 +135,6 @@ static INT OnShutdown(WPARAM wParam, LPARAM lParam) CtrlButtonUnloadModule();
SvcConstantsUnloadModule();
- UnhookEvent(ghPrebuildStatusMenu);
SvcEMailUnloadModule();
SvcFlagsUnloadModule();
SvcGenderUnloadModule();
@@ -256,9 +249,9 @@ extern "C" INT __declspec(dllexport) Load(void) SvcReminderLoadModule();
// Now the module is loaded! Start initializing certain things
- ghModulesLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- ghTopToolBarLoaded = HookEvent(ME_TTB_MODULELOADED, OnTopToolBarLoaded);
- ghShutdownHook = HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ HookEvent(ME_TTB_MODULELOADED, OnTopToolBarLoaded);
+ HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
return 0;
}
@@ -269,10 +262,8 @@ extern "C" INT __declspec(dllexport) Load(void) **/
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
{
- switch (fdwReason) {
- case DLL_PROCESS_ATTACH:
- ghInst = hinst;
- break;
- }
+ if (fdwReason == DLL_PROCESS_ATTACH)
+ ghInst = hinst;
+
return TRUE;
}
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 79dccee665..3bfc5b6084 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -782,9 +782,7 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw VOID SvcReminderOnTopToolBarLoaded()
{
- TTBButton ttb = {0};
- ttb.cbSize = sizeof(ttb);
-
+ TTBButton ttb = { sizeof(ttb) };
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_USERINFO_REMINDER_CHECK;
ttb.name = ttb.pszTooltipUp = LPGEN("Check anniversaries");
|