diff options
author | Mataes <mataes2007@gmail.com> | 2018-05-15 22:28:12 +0300 |
---|---|---|
committer | Mataes <mataes2007@gmail.com> | 2018-05-15 22:28:12 +0300 |
commit | 996fd46c8ef926f413b9860709cd891c20926141 (patch) | |
tree | 2dec8f6f87c32cccd0efec5e07d99b6d02c465c1 /plugins | |
parent | b1266b79e51534a5d5673639e49a8fdbbb747026 (diff) |
AddContact: cmplugin adaptation
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/AddContactPlus/src/addcontact.cpp | 1 | ||||
-rw-r--r-- | plugins/AddContactPlus/src/main.cpp | 15 | ||||
-rw-r--r-- | plugins/AddContactPlus/src/stdafx.h | 11 |
3 files changed, 12 insertions, 15 deletions
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index a48157af37..5bb5c3212f 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "stdafx.h"
-#include <limits.h>
struct AddDialogParam : public MZeroedObject
{
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 30611ab8aa..98e2538eb3 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -22,7 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "stdafx.h"
CLIST_INTERFACE *pcli;
-HINSTANCE hInst;
+
+CMPlugin g_plugin;
int hLangpack;
static HANDLE hToolBarItem = nullptr;
static HGENMENU hMainMenuItem = nullptr;
@@ -53,21 +54,13 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) /////////////////////////////////////////////////////////////////////////////////////////
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInst = hinstDLL;
- return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
static INT_PTR AddContactPlusDialog(WPARAM, LPARAM)
{
if (hAddDlg) {
SetForegroundWindow(hAddDlg);
SetFocus(hAddDlg);
}
- else hAddDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDCONTACT), nullptr, AddContactDlgProc, 0);
+ else hAddDlg = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_ADDCONTACT), nullptr, AddContactDlgProc, 0);
return 0;
}
@@ -145,7 +138,7 @@ extern "C" int __declspec(dllexport) Load(void) INITCOMMONCONTROLSEX icex = { sizeof(icex), ICC_USEREX_CLASSES };
InitCommonControlsEx(&icex);
- Icon_Register(hInst, LPGEN("AddContact+"), &icon, 1);
+ Icon_Register(g_plugin.getInst(), LPGEN("AddContact+"), &icon, 1);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccListChanged);
diff --git a/plugins/AddContactPlus/src/stdafx.h b/plugins/AddContactPlus/src/stdafx.h index b1e2da7dfd..8626486757 100644 --- a/plugins/AddContactPlus/src/stdafx.h +++ b/plugins/AddContactPlus/src/stdafx.h @@ -23,8 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <windows.h>
#include <commctrl.h>
-
-#define __NO_CMPLUGIN_NEEDED
+#include <limits.h>
#include <win2k.h>
#include <newpluginapi.h>
@@ -45,8 +44,14 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "resource.h"
#include "version.h"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>("AddContact")
+ {}
+};
+
#define ICON_ADD "AddContactPlus_Icon"
INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam);
-extern HINSTANCE hInst;
extern HWND hAddDlg;
|