diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Toaster/src/toast_notification.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp index 1b22086b9e..d9ecb3a564 100644 --- a/plugins/Toaster/src/toast_notification.cpp +++ b/plugins/Toaster/src/toast_notification.cpp @@ -26,13 +26,18 @@ ToastNotification::ToastNotification( void *pData)
: _text(text), _caption(caption), _imagePath(imagePath), _hContact(hContact), _pfnPopupProc(pWndProc), _pvPopupData(pData)
{
- {
- mir_cslock lck(csNotifications);
+ { mir_cslock lck(csNotifications);
lstNotifications.insert(this);
}
- Windows::Foundation::GetActivationFactory(StringReferenceWrapper(RuntimeClass_Windows_UI_Notifications_ToastNotificationManager).Get(), ¬ificationManager);
- notificationManager->CreateToastNotifierWithId(StringReferenceWrapper(::AppUserModelID).Get(), ¬ifier);
- Create(¬ification);
+
+ if (FAILED(Windows::Foundation::GetActivationFactory(StringReferenceWrapper(RuntimeClass_Windows_UI_Notifications_ToastNotificationManager).Get(), ¬ificationManager)))
+ return;
+
+ if (FAILED(notificationManager->CreateToastNotifierWithId(StringReferenceWrapper(::AppUserModelID).Get(), ¬ifier)))
+ return;
+
+ if (FAILED(Create(¬ification)))
+ return;
notification->add_Activated(Callback<ToastActivationHandler>(this, &ToastNotification::OnActivate).Get(), &_ertActivated);
notification->add_Dismissed(Callback<ToastDismissHandler>(this, &ToastNotification::OnDismiss).Get(), &_ertDismissed);
|