summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt/src/hooked_events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/WhenWasIt/src/hooked_events.cpp')
-rw-r--r--plugins/WhenWasIt/src/hooked_events.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp
index 71d19ec82f..789b36a4cc 100644
--- a/plugins/WhenWasIt/src/hooked_events.cpp
+++ b/plugins/WhenWasIt/src/hooked_events.cpp
@@ -28,6 +28,7 @@ UINT_PTR hCheckTimer = NULL;
UINT_PTR hDateChangeTimer = NULL;
static int currentDay = 0;
+void CloseUpcoming();
static int OnTopToolBarModuleLoaded(WPARAM, LPARAM)
{
@@ -49,7 +50,19 @@ static int OnContactSettingChanged(WPARAM hContact, LPARAM lParam)
return 0;
}
-int OnModulesLoaded(WPARAM, LPARAM)
+static int OnShutdown(WPARAM, LPARAM)
+{
+ if (hBirthdaysDlg)
+ SendMessage(hBirthdaysDlg, WM_CLOSE, 0, 0);
+
+ CloseUpcoming();
+
+ WindowList_Broadcast(hAddBirthdayWndsList, WM_CLOSE, 0, 0);
+ WindowList_Destroy(hAddBirthdayWndsList);
+ return 0;
+}
+
+static int OnModulesLoaded(WPARAM, LPARAM)
{
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
HookEvent(ME_TTB_MODULELOADED, OnTopToolBarModuleLoaded);
@@ -60,6 +73,7 @@ int OnModulesLoaded(WPARAM, LPARAM)
int HookEvents()
{
+ HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
HookEvent(ME_OPT_INITIALISE, OnOptionsInitialise);
return 0;