From 067a48827e8bae1bc595f3268e18996314843396 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 17 May 2018 20:53:02 +0300 Subject: OpenFolder, PackUpdater, PasteIt, Ping, QuickMessages, QuickReplies, Sessions, TranslitSwitcher => CMPlugin --- plugins/OpenFolder/src/openFolder.cpp | 29 +++++++++++++++++------------ plugins/OpenFolder/src/stdafx.h | 1 - 2 files changed, 17 insertions(+), 13 deletions(-) (limited to 'plugins/OpenFolder/src') 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() : + PLUGIN(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 #include -#define __NO_CMPLUGIN_NEEDED #include #include #include -- cgit v1.2.3