diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-17 20:53:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-17 20:53:02 +0300 |
commit | 067a48827e8bae1bc595f3268e18996314843396 (patch) | |
tree | d51ae1287c40f08f291f5578b2dccf69f902cc97 /plugins/OpenFolder | |
parent | 7639f72273189df60566755c0d5f1e4ab7201b67 (diff) |
OpenFolder, PackUpdater, PasteIt, Ping, QuickMessages, QuickReplies, Sessions, TranslitSwitcher => CMPlugin
Diffstat (limited to 'plugins/OpenFolder')
-rw-r--r-- | plugins/OpenFolder/src/openFolder.cpp | 29 | ||||
-rw-r--r-- | plugins/OpenFolder/src/stdafx.h | 1 |
2 files changed, 17 insertions, 13 deletions
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index 695aa6ac73..c2898261d1 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -1,9 +1,18 @@ #include "stdafx.h"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr)
+ {}
+}
+g_plugin;
+
int hLangpack = 0;
-HINSTANCE hInst;
HANDLE hButtonTopToolbar;
+/////////////////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
@@ -18,14 +27,15 @@ PLUGININFOEX pluginInfoEx = {0x10896143, 0x7249, 0x4b36, {0xa4, 0x8, 0x65, 0x1, 0xa6, 0xb6, 0x3, 0x5a}}
};
-static IconItem icon = { LPGEN("Open Folder"), "open", IDI_FOLDER };
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- hInst = hinstDLL;
- return TRUE;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static IconItem icon = { LPGEN("Open Folder"), "open", IDI_FOLDER };
+
static INT_PTR MenuCommand_OpenFolder(WPARAM, LPARAM)
{
wchar_t szMirandaPath[MAX_PATH];
@@ -67,11 +77,6 @@ HICON LoadIconExEx(const char* IcoLibName, int) return IcoLib_GetIcon(szSettingName);
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfoEx;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
extern "C" int __declspec(dllexport) Load()
@@ -83,7 +88,7 @@ extern "C" int __declspec(dllexport) Load() HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
// icolib (0.7+)
- Icon_Register(hInst, LPGEN("Open Folder"), &icon, 1, OPENFOLDER_MODULE_NAME);
+ Icon_Register(g_plugin.getInst(), LPGEN("Open Folder"), &icon, 1, OPENFOLDER_MODULE_NAME);
// hotkeys service (0.8+)
HOTKEYDESC hotkey = {};
diff --git a/plugins/OpenFolder/src/stdafx.h b/plugins/OpenFolder/src/stdafx.h index ea39d7d6da..2020c78b28 100644 --- a/plugins/OpenFolder/src/stdafx.h +++ b/plugins/OpenFolder/src/stdafx.h @@ -3,7 +3,6 @@ #include <windows.h>
#include <commctrl.h>
-#define __NO_CMPLUGIN_NEEDED
#include <newpluginapi.h>
#include <m_clist.h>
#include <m_icolib.h>
|