From 7639f72273189df60566755c0d5f1e4ab7201b67 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 17 May 2018 20:51:37 +0300 Subject: NewAwaySys, NewEventNotify, NewXstatusNotify, NoHistory, NotesReminders, NotifyAnything, Nudge => CMPlugin --- plugins/NotifyAnything/src/main.cpp | 22 ++++++++++++---------- plugins/NotifyAnything/src/options.cpp | 2 +- plugins/NotifyAnything/src/stdafx.h | 10 +++++++--- 3 files changed, 20 insertions(+), 14 deletions(-) (limited to 'plugins/NotifyAnything/src') diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index 2cef244540..a08a7d7dce 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -24,10 +24,13 @@ volatile bool g_exit_threads, g_firstrun; std::wstring g_mirandaDir; mir_cs g_wsocklock; -HINSTANCE hInst; +CMPlugin g_plugin; int hLangpack; -PLUGININFOEX pluginInfo = { +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfo = +{ sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -40,13 +43,13 @@ PLUGININFOEX pluginInfo = { { 0xe92874ec, 0x594a, 0x4a2f, { 0xbd, 0xed, 0xc0, 0xbe, 0x8b, 0x5a, 0x45, 0xd1 } } }; -BOOL WINAPI DllMain(HINSTANCE hi, DWORD, LPVOID) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - hInst = hi; - DisableThreadLibraryCalls(hInst); - return TRUE; + return &pluginInfo; } +///////////////////////////////////////////////////////////////////////////////////////// + enum replace_mode_t { xno, xappend, @@ -962,10 +965,7 @@ void stop_threads() WaitForSingleObject(g_tcp_thread, INFINITE); } -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) -{ - return &pluginInfo; -} +///////////////////////////////////////////////////////////////////////////////////////// extern "C" int __declspec(dllexport) Load() { @@ -988,6 +988,8 @@ extern "C" int __declspec(dllexport) Load() return 0; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" int __declspec(dllexport) Unload(void) { stop_threads(); diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp index abeea38393..41e983dcba 100644 --- a/plugins/NotifyAnything/src/options.cpp +++ b/plugins/NotifyAnything/src/options.cpp @@ -177,7 +177,7 @@ int OptionsInitialize(WPARAM wParam, LPARAM) odp.szTitle.a = LPGEN("Notify Anything"); odp.szGroup.a = LPGEN("Plugins"); odp.position = 100000000; - odp.hInstance = hInst; + odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS; Options_AddPage(wParam, &odp); return 0; diff --git a/plugins/NotifyAnything/src/stdafx.h b/plugins/NotifyAnything/src/stdafx.h index 730eaecb78..1eaf2a7da5 100644 --- a/plugins/NotifyAnything/src/stdafx.h +++ b/plugins/NotifyAnything/src/stdafx.h @@ -11,7 +11,6 @@ #include #include -#define __NO_CMPLUGIN_NEEDED #include "newpluginapi.h" #include "m_options.h" #include "m_skin.h" @@ -22,10 +21,15 @@ #include "resource.h" #include "version.h" -extern HINSTANCE hInst; - const char PlugName[] = "NotifyAnything"; +struct CMPlugin : public PLUGIN +{ + CMPlugin() : + PLUGIN(PlugName) + {} +}; + //--------------------------- //---Internal Hooks (see main.c) //---(Workaround till CallServiceSync is available) -- cgit v1.2.3