From 1a4f30d78b1986f3f79558de725c8f34dae3ee75 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 30 Jul 2022 18:15:50 +0300 Subject: WhenWasIt: all dialogs -> UI classes --- plugins/WhenWasIt/src/hooked_events.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'plugins/WhenWasIt/src/hooked_events.cpp') 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; -- cgit v1.2.3