summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/toast_event_handler.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-29 13:33:25 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-29 13:33:25 +0000
commit98f090a525e33973738e4105b6e8257ab34ff6eb (patch)
tree6aecfaef0cc0d24eab8134fb690f92df10d8668b /plugins/Toaster/src/toast_event_handler.cpp
parent8235db586d12c56b18ebf4d1279c873b4fe7cac7 (diff)
Toaster: code optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@15471 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/toast_event_handler.cpp')
-rw-r--r--plugins/Toaster/src/toast_event_handler.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/Toaster/src/toast_event_handler.cpp b/plugins/Toaster/src/toast_event_handler.cpp
index 5b1bdaf1f5..e312f7a8e1 100644
--- a/plugins/Toaster/src/toast_event_handler.cpp
+++ b/plugins/Toaster/src/toast_event_handler.cpp
@@ -5,14 +5,12 @@ using namespace Microsoft::WRL;
ToastEventHandler::ToastEventHandler(_In_ ToastHandlerData *pData) : _ref(0), _thd(pData)
{
- if (_thd->pPopupProc)
- _thd->pPopupProc((HWND)this, UM_INITPOPUP, (WPARAM)this, 0);
+ CallPopupProc(UM_INITPOPUP);
}
ToastEventHandler::~ToastEventHandler()
{
- if (_thd->pPopupProc)
- _thd->pPopupProc((HWND)this, UM_FREEPLUGINDATA, 0, 0);
+ CallPopupProc(UM_FREEPLUGINDATA);
}
IFACEMETHODIMP_(ULONG) ToastEventHandler::AddRef()
@@ -46,11 +44,8 @@ IFACEMETHODIMP ToastEventHandler::QueryInterface(_In_ REFIID riid, _COM_Outptr_
IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification*, _In_ IInspectable*)
{
- if (_thd->pPopupProc)
- _thd->pPopupProc((HWND)this, WM_COMMAND, 0, 0);
-
+ CallPopupProc(WM_COMMAND);
DestroyNotification();
-
return S_OK;
}
@@ -63,8 +58,7 @@ IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification*, _In_ IToastDi
{
case ToastDismissalReason_UserCanceled:
{
- if (_thd->pPopupProc)
- _thd->pPopupProc((HWND)this, WM_CONTEXTMENU, 0, 0);
+ CallPopupProc(WM_CONTEXTMENU);
_thd->tstNotification->Hide();
break;
}
@@ -89,6 +83,12 @@ void ToastEventHandler::DestroyNotification()
lstNotifications.remove(_thd->tstNotification);
}
+void ToastEventHandler::CallPopupProc(UINT uMsg)
+{
+ if (_thd->pPopupProc)
+ _thd->pPopupProc((HWND)this, uMsg, 0, 0);
+}
+
void* ToastEventHandler::GetPluginData()
{
return _thd->vPopupData;