summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-10-02 19:03:04 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-10-02 19:03:04 +0000
commit0603b6d7050a237f899d29f5557e3682447dd811 (patch)
tree8a33d8a921edf866432f677ec6794f93300b6152 /plugins/Toaster/src
parent195e0f57ed995f77b5e7296708ecaab982533591 (diff)
popup hiding moved in plugin
git-svn-id: http://svn.miranda-ng.org/main/trunk@15498 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src')
-rw-r--r--plugins/Toaster/src/services.cpp7
-rw-r--r--plugins/Toaster/src/toast_event_handler.cpp5
-rw-r--r--plugins/Toaster/src/toast_event_handler.h1
-rw-r--r--plugins/Toaster/src/toast_notification.h2
4 files changed, 15 insertions, 0 deletions
diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp
index 973625c35f..d930426906 100644
--- a/plugins/Toaster/src/services.cpp
+++ b/plugins/Toaster/src/services.cpp
@@ -259,6 +259,11 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam)
return ShowMessageW(tszText, lParam);
}
+static INT_PTR HideToast(WPARAM, LPARAM lParam)
+{
+ static_cast<ToastNotification*>(reinterpret_cast<ToastEventHandler*>(lParam)->GetToastNotification())->Hide();
+ return 0;
+}
void __stdcall HideAllToasts(void*)
{
mir_cslock lck(csNotifications);
@@ -283,4 +288,6 @@ void InitServices()
CreateServiceFunction(MS_POPUP_GETPLUGINDATA, GetPopupData);
CreateServiceFunction(MS_POPUP_GETCONTACT, GetPopupContact);
+
+ CreateServiceFunction(MS_POPUP_DESTROYPOPUP, HideToast);
} \ No newline at end of file
diff --git a/plugins/Toaster/src/toast_event_handler.cpp b/plugins/Toaster/src/toast_event_handler.cpp
index a31a0d342b..6248cf9eaa 100644
--- a/plugins/Toaster/src/toast_event_handler.cpp
+++ b/plugins/Toaster/src/toast_event_handler.cpp
@@ -99,4 +99,9 @@ void* ToastEventHandler::GetPluginData()
MCONTACT ToastEventHandler::GetContact()
{
return _thd->hContact;
+}
+
+void* ToastEventHandler::GetToastNotification()
+{
+ return _thd->tstNotification;
} \ No newline at end of file
diff --git a/plugins/Toaster/src/toast_event_handler.h b/plugins/Toaster/src/toast_event_handler.h
index a0efcbac2e..2626436540 100644
--- a/plugins/Toaster/src/toast_event_handler.h
+++ b/plugins/Toaster/src/toast_event_handler.h
@@ -24,6 +24,7 @@ public:
void* GetPluginData();
MCONTACT GetContact();
+ void* GetToastNotification();
private:
ULONG _ref;
diff --git a/plugins/Toaster/src/toast_notification.h b/plugins/Toaster/src/toast_notification.h
index 30bb591f3d..4399248848 100644
--- a/plugins/Toaster/src/toast_notification.h
+++ b/plugins/Toaster/src/toast_notification.h
@@ -1,6 +1,8 @@
#ifndef _TOAST_NOTIFICATION_H_
#define _TOAST_NOTIFICATION_H_
+struct ToastHandlerData;
+
class ToastNotification
{
private: