summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Toaster/src/toast_notification.cpp16
-rw-r--r--plugins/Toaster/src/toast_notification.h4
-rw-r--r--plugins/Toaster/src/version.h2
3 files changed, 14 insertions, 8 deletions
diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp
index b8667de1c6..38c04f0066 100644
--- a/plugins/Toaster/src/toast_notification.cpp
+++ b/plugins/Toaster/src/toast_notification.cpp
@@ -28,6 +28,7 @@ ToastNotification::ToastNotification(
ToastNotification::~ToastNotification()
{
+ _signature = 0;
if (_pvPopupData != nullptr)
CallPopupProc(UM_FREEPLUGINDATA);
notifier->Hide(notification.Get());
@@ -92,17 +93,20 @@ HRESULT ToastNotification::OnActivate(_In_ ABI::Windows::UI::Notifications::IToa
HRESULT ToastNotification::OnDismiss(_In_ ABI::Windows::UI::Notifications::IToastNotification*, _In_ ABI::Windows::UI::Notifications::IToastDismissedEventArgs *e)
{
- ABI::Windows::UI::Notifications::ToastDismissalReason tdr;
- CHECKHR(e->get_Reason(&tdr));
- if (tdr == ABI::Windows::UI::Notifications::ToastDismissalReason_UserCanceled)
- CallPopupProc(WM_CONTEXTMENU);
- Destroy();
+ if (_signature == TOAST_SIGNATURE) {
+ ABI::Windows::UI::Notifications::ToastDismissalReason tdr;
+ CHECKHR(e->get_Reason(&tdr));
+ if (tdr == ABI::Windows::UI::Notifications::ToastDismissalReason_UserCanceled)
+ CallPopupProc(WM_CONTEXTMENU);
+ Destroy();
+ }
return S_OK;
}
HRESULT ToastNotification::OnFail(_In_ ABI::Windows::UI::Notifications::IToastNotification*, _In_ ABI::Windows::UI::Notifications::IToastFailedEventArgs*)
{
- Destroy();
+ if (_signature == TOAST_SIGNATURE)
+ Destroy();
return S_OK;
}
diff --git a/plugins/Toaster/src/toast_notification.h b/plugins/Toaster/src/toast_notification.h
index 812c361810..55add011e3 100644
--- a/plugins/Toaster/src/toast_notification.h
+++ b/plugins/Toaster/src/toast_notification.h
@@ -4,10 +4,12 @@ typedef __FITypedEventHandler_2_Windows__CUI__CNotifications__CToastNotification
typedef __FITypedEventHandler_2_Windows__CUI__CNotifications__CToastNotification_Windows__CUI__CNotifications__CToastDismissedEventArgs ToastDismissHandler;
typedef __FITypedEventHandler_2_Windows__CUI__CNotifications__CToastNotification_Windows__CUI__CNotifications__CToastFailedEventArgs ToastFailHandler;
+#define TOAST_SIGNATURE 0xABBABABA
+
class ToastNotification
{
private:
-
+ uint32_t _signature = TOAST_SIGNATURE;
MCONTACT _hContact;
WNDPROC _pfnPopupProc;
diff --git a/plugins/Toaster/src/version.h b/plugins/Toaster/src/version.h
index 785fe9a3ac..a269ca8021 100644
--- a/plugins/Toaster/src/version.h
+++ b/plugins/Toaster/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 11
#define __RELEASE_NUM 2
-#define __BUILD_NUM 0
+#define __BUILD_NUM 1
#include <stdver.h>