summaryrefslogtreecommitdiff
path: root/plugins/AuthState
diff options
context:
space:
mode:
authorKirill Volinsky <Mataes2007@gmail.com>2018-05-16 10:34:12 +0300
committerKirill Volinsky <Mataes2007@gmail.com>2018-05-16 10:34:12 +0300
commit9da2b2e8a9b7b7cd57374259f04475e309bcf586 (patch)
treefd61711110c0798018359187e34ab924c634d363 /plugins/AuthState
parent0bd2aba7306dd3f1f2118c0c1a6cb751dea8dce0 (diff)
AuthState: cmplugin adaptation
Diffstat (limited to 'plugins/AuthState')
-rw-r--r--plugins/AuthState/src/main.cpp10
-rw-r--r--plugins/AuthState/src/options.h2
-rw-r--r--plugins/AuthState/src/stdafx.h10
3 files changed, 10 insertions, 12 deletions
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp
index 675f8cbadf..4b5616fe45 100644
--- a/plugins/AuthState/src/main.cpp
+++ b/plugins/AuthState/src/main.cpp
@@ -19,9 +19,9 @@
#include "stdafx.h"
-HINSTANCE g_hInst;
static HGENMENU hUserMenu;
HANDLE hExtraIcon;
+CMPlugin g_plugin;
int hLangpack;
Opts Options;
@@ -54,12 +54,6 @@ PLUGININFOEX pluginInfo = {
{ 0xdace7d41, 0xdfa9, 0x4772, { 0x89, 0xae, 0xa5, 0x9a, 0x61, 0x53, 0xe6, 0xb2 } }
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- g_hInst = hinstDLL;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
@@ -185,7 +179,7 @@ extern "C" int __declspec(dllexport) Load(void)
hUserMenu = Menu_AddContactMenuItem(&mi);
// IcoLib support
- Icon_Register(g_hInst, LPGEN("Auth state"), iconList, _countof(iconList));
+ Icon_Register(g_plugin.getInst(), LPGEN("Auth state"), iconList, _countof(iconList));
return 0;
}
diff --git a/plugins/AuthState/src/options.h b/plugins/AuthState/src/options.h
index 66d2304a70..707eb7b2b5 100644
--- a/plugins/AuthState/src/options.h
+++ b/plugins/AuthState/src/options.h
@@ -26,7 +26,7 @@ class COptionsDialog : public CPluginDlgBase
CCtrlCheck m_chkOnlyForRecent;
public:
COptionsDialog() :
- CPluginDlgBase(g_hInst, IDD_AUTHSTATE_OPT, MODULENAME),
+ CPluginDlgBase(g_plugin.getInst(), IDD_AUTHSTATE_OPT, MODULENAME),
m_chkAuthIcon(this, IDC_AUTHICON),
m_chkGrantIcon(this, IDC_GRANTICON),
m_chkMenuItem(this, IDC_ENABLEMENUITEM),
diff --git a/plugins/AuthState/src/stdafx.h b/plugins/AuthState/src/stdafx.h
index 19e5dd4399..57701cd8c1 100644
--- a/plugins/AuthState/src/stdafx.h
+++ b/plugins/AuthState/src/stdafx.h
@@ -23,8 +23,6 @@
#include <windows.h>
// Miranda API headers
-#define __NO_CMPLUGIN_NEEDED
-
#include <newpluginapi.h>
#include <m_database.h>
#include <m_protocols.h>
@@ -40,10 +38,16 @@
#define MODULENAME "AuthState"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME)
+ {}
+};
+
int onOptInitialise(WPARAM wParam, LPARAM lParam);
int onExtraImageApplying(WPARAM wParam, LPARAM lParam);
-extern HINSTANCE g_hInst;
extern HANDLE hExtraIcon;
#include "options.h"