From 0603b6d7050a237f899d29f5557e3682447dd811 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Fri, 2 Oct 2015 19:03:04 +0000 Subject: popup hiding moved in plugin git-svn-id: http://svn.miranda-ng.org/main/trunk@15498 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/services.cpp | 7 +++++++ plugins/Toaster/src/toast_event_handler.cpp | 5 +++++ plugins/Toaster/src/toast_event_handler.h | 1 + plugins/Toaster/src/toast_notification.h | 2 ++ 4 files changed, 15 insertions(+) (limited to 'plugins/Toaster') 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(reinterpret_cast(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: -- cgit v1.2.3