From 8a74e7495ce5ad39de4f5c25121a84d35df90c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 15:08:48 +0300 Subject: CMPlugin to receive a reference to PLUGININFOEX --- plugins/Toaster/src/main.cpp | 14 +++++++++----- plugins/Toaster/src/options.cpp | 4 ++-- plugins/Toaster/src/stdafx.h | 6 ++---- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'plugins/Toaster') diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp index acf2eae2a6..f41dd3e512 100644 --- a/plugins/Toaster/src/main.cpp +++ b/plugins/Toaster/src/main.cpp @@ -5,7 +5,7 @@ CMPlugin g_plugin; ///////////////////////////////////////////////////////////////////////////////////////// -PLUGININFOEX pluginInfo = +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -19,13 +19,17 @@ PLUGININFOEX pluginInfo = { 0x1fdbd8f0, 0x3929, 0x41bc, { 0x92, 0xd1, 0x2, 0x7, 0x79, 0x46, 0x7, 0x69 } } }; +CMPlugin::CMPlugin() : + PLUGIN(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { if (!IsWinVer8Plus()) { - MessageBox(nullptr, TranslateT("This plugin requires Windows 8 or higher"), _T(MODULE), MB_OK | MB_ICONERROR); + MessageBox(nullptr, TranslateT("This plugin requires Windows 8 or higher"), _T(MODULENAME), MB_OK | MB_ICONERROR); return nullptr; } - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -51,7 +55,7 @@ static int OnPreShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); HookEvent(ME_OPT_INITIALISE, OnOptionsInitialized); HookEvent(ME_SYSTEM_PRESHUTDOWN, &OnPreShutdown); @@ -65,7 +69,7 @@ extern "C" int __declspec(dllexport) Load(void) if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) CreateDirectoryTreeW(wszTempDir); } - else MessageBox(nullptr, TranslateT("Failed to create temporary directory"), _T(MODULE), MB_OK | MB_ICONERROR); + else MessageBox(nullptr, TranslateT("Failed to create temporary directory"), _T(MODULENAME), MB_OK | MB_ICONERROR); return 0; } diff --git a/plugins/Toaster/src/options.cpp b/plugins/Toaster/src/options.cpp index 5475b67e54..da2e46ae84 100644 --- a/plugins/Toaster/src/options.cpp +++ b/plugins/Toaster/src/options.cpp @@ -46,10 +46,10 @@ void COptions::Enabled_OnChange(CCtrlCheck* chk) int OnOptionsInitialized(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; - odp.szTitle.w = L"Popups"; //_T(MODULE); + odp.szTitle.w = L"Popups"; //_T(MODULENAME); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.position = -790000000; - odp.szTab.w = _T(MODULE); + odp.szTab.w = _T(MODULENAME); odp.pDialog = new COptions(); Options_AddPage(wParam, &odp); diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h index 1d337c7cf8..a5914af140 100644 --- a/plugins/Toaster/src/stdafx.h +++ b/plugins/Toaster/src/stdafx.h @@ -29,14 +29,12 @@ const wchar_t AppUserModelID[] = L"MirandaNG"; -#define MODULE "Toaster" +#define MODULENAME "Toaster" #define CHECKHR(x) if (FAILED(x)) return x; struct CMPlugin : public PLUGIN { - CMPlugin() : - PLUGIN(MODULE) - {} + CMPlugin(); }; class ToastNotification; -- cgit v1.2.3