summaryrefslogtreecommitdiff
path: root/plugins/OpenFolder
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/OpenFolder')
-rw-r--r--plugins/OpenFolder/src/openFolder.cpp29
-rw-r--r--plugins/OpenFolder/src/stdafx.h1
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>