summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-13 16:04:27 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-13 16:04:27 +0000
commit16cdfa5e933566f2181fecc764b74a01b869d793 (patch)
treede6bb584e1404c3a222e69285caff23a800c1b24 /plugins/Toaster/src
parentcf0be00671d56bb18118e1491e7c1f0e131e7b3d (diff)
Toaster: small fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15346 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src')
-rw-r--r--plugins/Toaster/src/toast_event_handler.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/plugins/Toaster/src/toast_event_handler.cpp b/plugins/Toaster/src/toast_event_handler.cpp
index 31c3a97eef..485e5e5976 100644
--- a/plugins/Toaster/src/toast_event_handler.cpp
+++ b/plugins/Toaster/src/toast_event_handler.cpp
@@ -10,7 +10,7 @@ ToastEventHandler::ToastEventHandler() : _ref(1)
ToastEventHandler::ToastEventHandler(_In_ ToastHandlerData *pData) : _ref(1), _thd(pData)
{
if (_thd->pPopupProc)
- _thd->pPopupProc((HWND)this, UM_INITPOPUP, 0, 0);
+ _thd->pPopupProc((HWND)this, UM_INITPOPUP, (WPARAM)this, 0);
}
ToastEventHandler::~ToastEventHandler()
@@ -58,12 +58,32 @@ IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification * /*sender*/, _
return S_OK;
}
-IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification* /* sender */, _In_ IToastDismissedEventArgs* /*e*/)
+IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification* /* sender */, _In_ IToastDismissedEventArgs* e)
{
- if (_thd->pPopupProc)
- _thd->pPopupProc((HWND)this, WM_CONTEXTMENU, 0, 0);
- _thd->tstNotification->Hide();
- delete this;
+ ToastDismissalReason tdr;
+ CHECKHR(e->get_Reason(&tdr));
+
+ switch (tdr)
+ {
+ case ToastDismissalReason_ApplicationHidden:
+ {
+ if (_thd->pPopupProc)
+ _thd->pPopupProc((HWND)this, WM_CONTEXTMENU, 0, 0);
+ delete this;
+ break;
+ }
+ case ToastDismissalReason_UserCanceled:
+ {
+ if (_thd->pPopupProc)
+ _thd->pPopupProc((HWND)this, WM_CONTEXTMENU, 0, 0);
+ _thd->tstNotification->Hide();
+ delete this;
+ break;
+ }
+ case ToastDismissalReason_TimedOut:
+ delete this; // should be rewritten
+ break;
+ }
return S_OK;
}