summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/services.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-16 12:35:57 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-16 12:35:57 +0000
commitd0a1040e019092c29d8d2a2c2a29bc1e7644a5e5 (patch)
tree9297e79ab09653aa870c5ef83c163673fbce8e6c /plugins/Toaster/src/services.cpp
parent87208846a0e7fd82e246dd1e6a9cddfc0ca159e4 (diff)
Toaster: more optimizations
git-svn-id: http://svn.miranda-ng.org/main/trunk@15361 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/services.cpp')
-rw-r--r--plugins/Toaster/src/services.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp
index 79e7acca08..08641fa15e 100644
--- a/plugins/Toaster/src/services.cpp
+++ b/plugins/Toaster/src/services.cpp
@@ -75,12 +75,12 @@ void __stdcall ShowToastNotification(void* p)
static INT_PTR GetPopupData(WPARAM wParam, LPARAM)
{
- return (INT_PTR)((ToastEventHandler*)wParam)->_thd->vPopupData;
+ return (INT_PTR)((ToastEventHandler*)wParam)->GetPluginData();
}
static INT_PTR GetPopupContact(WPARAM wParam, LPARAM)
{
- return (INT_PTR)((ToastEventHandler*)wParam)->_thd->hContact;
+ return (INT_PTR)((ToastEventHandler*)wParam)->GetContact();
}
static INT_PTR CreatePopup(WPARAM wParam, LPARAM)
@@ -231,7 +231,7 @@ static INT_PTR PopupQuery(WPARAM wParam, LPARAM)
}
}
-static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam)
+static INT_PTR ShowMessageW(WPARAM wParam, LPARAM lParam)
{
HICON hIcon = NULL;
switch (lParam)
@@ -247,19 +247,16 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam)
break;
}
- ptrT tszText(mir_utf8decodeT((char*)wParam));
- ToastData *td = new ToastData(NULL, NULL, tszText, hIcon);
-
+ ToastData *td = new ToastData(NULL, NULL, (wchar_t*)wParam, hIcon);
CallFunctionAsync(&ShowToastNotification, td);
return 0;
}
-static INT_PTR ShowMessageW(WPARAM wParam, LPARAM)
-{
- ToastData *td = new ToastData(NULL, NULL, (wchar_t*)wParam, HICON(0));
- CallFunctionAsync(&ShowToastNotification, td);
- return 0;
+static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam)
+{
+ ptrT tszText(mir_utf8decodeW((char*)wParam));
+ return ShowMessageW(tszText, lParam);
}
void __stdcall HideAllToasts(void*)
@@ -280,6 +277,7 @@ void InitServices()
CreateServiceFunction(MS_POPUP_ADDPOPUP, CreatePopup);
CreateServiceFunction(MS_POPUP_ADDPOPUPW, CreatePopupW);
CreateServiceFunction(MS_POPUP_ADDPOPUP2, CreatePopup2);
+
CreateServiceFunction(MS_POPUP_QUERY, PopupQuery);
CreateServiceFunction(MS_POPUP_ADDPOPUPCLASS, CreateClassPopup);