diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-17 21:37:53 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-17 21:37:53 +0300 |
commit | 88b04fed4966b0f1686690cb6101854afb52a5ee (patch) | |
tree | 79b4e574c0849f24907168075c8d0babfde2fde4 /plugins/Rate | |
parent | 5ebe9c34375bce857ad3160abba67d6ed2beadaf (diff) |
Db3x_mmap, Dbx_mdbx, Exchange, MyDetails, RecentContacts, TopToolBar, WebView => CMPlugin
Diffstat (limited to 'plugins/Rate')
-rw-r--r-- | plugins/Rate/src/main.cpp | 23 | ||||
-rw-r--r-- | plugins/Rate/src/stdafx.h | 6 |
2 files changed, 14 insertions, 15 deletions
diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index f0df6cdaa6..0e6d3a20ca 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -35,11 +35,20 @@ #include "stdafx.h"
-HINSTANCE g_hInst;
-
static HANDLE hExtraIcon = nullptr;
+
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME)
+ {}
+}
+g_plugin;
+
int hLangpack;
+///////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfo =
{
sizeof(PLUGININFOEX),
@@ -54,12 +63,6 @@ PLUGININFOEX pluginInfo = {0x45230488, 0x977b, 0x405b, {0x85, 0x6d, 0xea, 0x27, 0x6d, 0x70, 0x83, 0xb7}}
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- g_hInst = hinstDLL;
- return TRUE;
-}
-
// плагининфо
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
@@ -123,13 +126,15 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
// IcoLib support
- Icon_Register(g_hInst, LPGEN("Contact rate"), iconList, _countof(iconList));
+ Icon_Register(g_plugin.getInst(), LPGEN("Contact rate"), iconList, _countof(iconList));
// Extra icon support
hExtraIcon = ExtraIcon_RegisterIcolib("contact_rate", LPGEN("Contact rate"), "rate_high");
return 0;
}
+///////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
diff --git a/plugins/Rate/src/stdafx.h b/plugins/Rate/src/stdafx.h index f8b23375a5..9226bf1c7a 100644 --- a/plugins/Rate/src/stdafx.h +++ b/plugins/Rate/src/stdafx.h @@ -18,12 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef COMMHEADERS_H
-#define COMMHEADERS_H
-
#include <windows.h>
-#define __NO_CMPLUGIN_NEEDED
#include <win2k.h>
#include <newpluginapi.h>
#include <m_database.h>
@@ -34,5 +30,3 @@ #include "version.h"
#define MODULENAME "Rate"
-
-#endif //COMMHEADERS_H
|