diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-28 11:32:10 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-28 11:32:10 +0000 |
commit | 4402f6924f14847c1570b22ef06ba54125a9c41c (patch) | |
tree | b474f5c3ef8660c0919474eb8c6e4a4dc15bb0a0 /plugins/Toaster/src/toast_notification.cpp | |
parent | f056d6596882aa7cfecc21a61e8ef48f2b514460 (diff) |
Toaster: hiding toasts
git-svn-id: http://svn.miranda-ng.org/main/trunk@15053 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/toast_notification.cpp')
-rw-r--r-- | plugins/Toaster/src/toast_notification.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp index 9e3ad1b915..7d11f9318e 100644 --- a/plugins/Toaster/src/toast_notification.cpp +++ b/plugins/Toaster/src/toast_notification.cpp @@ -215,21 +215,27 @@ HRESULT ToastNotification::Show(_In_ ToastEventHandler* handler) if (FAILED(hr))
RaiseException(static_cast<DWORD>(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr);
- Microsoft::WRL::ComPtr<ABI::Windows::UI::Notifications::IToastNotifier> notifier;
hr = notificationManager->CreateToastNotifierWithId(StringReferenceWrapper(::AppUserModelID).Get(), ¬ifier);
if (FAILED(hr))
return hr;
-
- Microsoft::WRL::ComPtr<ABI::Windows::UI::Notifications::IToastNotification> notification;
hr = Create(¬ification);
if (FAILED(hr))
return hr;
- EventRegistrationToken activatedToken;
+ EventRegistrationToken activatedToken, dismissedToken, failedToken;
Microsoft::WRL::ComPtr<ToastEventHandler> eventHandler(handler);
hr = notification->add_Activated(eventHandler.Get(), &activatedToken);
if (FAILED(hr))
return hr;
+ notification->add_Activated(eventHandler.Get(), &activatedToken);
+ notification->add_Dismissed(eventHandler.Get(), &dismissedToken);
+ notification->add_Failed(eventHandler.Get(), &failedToken);
+
return notifier->Show(notification.Get());
+}
+
+HRESULT ToastNotification::Hide()
+{
+ return notifier->Hide(notification.Get());
}
\ No newline at end of file |