diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-17 20:50:08 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-17 20:50:08 +0300 |
commit | 523f3588b6f21adcc4bcf3ec3ffad05e2298863a (patch) | |
tree | 428f9611be9bfdba157f5c2056908ee02c9c7ce6 /plugins/MessageState/src | |
parent | 11e70d8c4e224d80015fffe0378c53abee5fd824 (diff) |
KeyboardNotify, ListeningTo, MessageState, MirandaG15, MirFox, Msg_Export, MsgPopup, mTextControl => CMPlugin
Diffstat (limited to 'plugins/MessageState/src')
-rw-r--r-- | plugins/MessageState/src/main.cpp | 14 | ||||
-rw-r--r-- | plugins/MessageState/src/messagestate.cpp | 2 | ||||
-rw-r--r-- | plugins/MessageState/src/stdafx.h | 10 |
3 files changed, 15 insertions, 11 deletions
diff --git a/plugins/MessageState/src/main.cpp b/plugins/MessageState/src/main.cpp index 519522b54d..1eab147bb8 100644 --- a/plugins/MessageState/src/main.cpp +++ b/plugins/MessageState/src/main.cpp @@ -1,7 +1,9 @@ #include "stdafx.h"
int hLangpack;
-HINSTANCE g_hInst;
+CMPlugin g_plugin;
+
+/////////////////////////////////////////////////////////////////////////////////////////
PLUGININFOEX pluginInfo =
{
@@ -18,17 +20,13 @@ PLUGININFOEX pluginInfo = };
-BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD, LPVOID)
-{
- g_hInst = hInstance;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
@@ -37,6 +35,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index 3512aed20d..d0fa273b89 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -99,7 +99,7 @@ int OnModulesLoaded(WPARAM, LPARAM) HookEvent(ME_PROTO_ACK, OnProtoAck);
HookEvent(ME_DB_EVENT_FILTER_ADD, OnEventFilterAdd);
- Icon_Register(g_hInst, MODULENAME, Icons, _countof(Icons));
+ Icon_Register(g_plugin.getInst(), MODULENAME, Icons, _countof(Icons));
StatusIconData sid = {};
sid.szModule = MODULENAME;
diff --git a/plugins/MessageState/src/stdafx.h b/plugins/MessageState/src/stdafx.h index 4efd7ab1f4..13827de990 100644 --- a/plugins/MessageState/src/stdafx.h +++ b/plugins/MessageState/src/stdafx.h @@ -4,8 +4,6 @@ #include <time.h>
#include <locale.h>
-#define __NO_CMPLUGIN_NEEDED
-
#include <m_messagestate.h>
#include <newpluginapi.h>
#include <m_database.h>
@@ -22,5 +20,11 @@ #define MODULENAME "MessageState"
-extern HINSTANCE g_hInst;
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME)
+ {}
+};
+
extern IconItem Icons[];
\ No newline at end of file |