diff options
author | Kirill Volinsky <Mataes2007@gmail.com> | 2018-05-16 15:21:16 +0300 |
---|---|---|
committer | Kirill Volinsky <Mataes2007@gmail.com> | 2018-05-16 15:21:16 +0300 |
commit | 86ce33563c240d57aa3f8974a801aaa75cbb548a (patch) | |
tree | a55ad8bb07c7c1b40f55c75ac546d440559cafe4 /plugins/BASS_interface/src | |
parent | 817fe8d07eb67428f0dd2f587eee002d6319fef8 (diff) |
BASS_interface: cmplugin adaptation
Diffstat (limited to 'plugins/BASS_interface/src')
-rw-r--r-- | plugins/BASS_interface/src/Main.cpp | 16 | ||||
-rw-r--r-- | plugins/BASS_interface/src/stdafx.h | 9 |
2 files changed, 12 insertions, 13 deletions
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index a7277ed097..f2d0e60a1f 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -30,7 +30,7 @@ FARPROC WINAPI delayHook(unsigned dliNotify, PDelayLoadInfo dli) extern "C" PfnDliHook __pfnDliNotifyHook2 = delayHook;
-HINSTANCE hInst;
+CMPlugin g_plugin;
int hLangpack;
CLIST_INTERFACE *pcli;
@@ -47,12 +47,6 @@ PLUGININFOEX pluginInfo = { { 0x2f07ea05, 0x05b5, 0x4ff0, { 0x87, 0x5d, 0xc5, 0x90, 0xda, 0x2d, 0xda, 0xc1 } }
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInst = hinstDLL;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
@@ -314,7 +308,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara int OptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = hInst;
+ odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.a = ModuleName;
odp.pfnDlgProc = OptionsProc;
@@ -443,13 +437,13 @@ void CreateFrame() WNDCLASS wndclass = { 0 };
wndclass.lpfnWndProc = FrameWindowProc;
- wndclass.hInstance = hInst;
+ wndclass.hInstance = g_plugin.getInst();
wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.lpszClassName = L"BassInterfaceFrame";
RegisterClass(&wndclass);
hwnd_plugin = CreateWindow(L"BassInterfaceFrame", TranslateT("BASS Interface"),
- WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, pcli->hwndContactList, nullptr, hInst, nullptr);
+ WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr);
CLISTFrame Frame = { sizeof(CLISTFrame) };
Frame.tname = TranslateT("BASS Interface");
@@ -603,7 +597,7 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnSettingChanged);
- Icon_Register(hInst, ModuleName, iconList, _countof(iconList));
+ Icon_Register(g_plugin.getInst(), ModuleName, iconList, _countof(iconList));
return 0;
}
diff --git a/plugins/BASS_interface/src/stdafx.h b/plugins/BASS_interface/src/stdafx.h index d804face02..306c6a5a88 100644 --- a/plugins/BASS_interface/src/stdafx.h +++ b/plugins/BASS_interface/src/stdafx.h @@ -8,8 +8,6 @@ Copyright (C) 2010, 2011 tico-tico #include <commctrl.h>
#include <Uxtheme.h>
-#define __NO_CMPLUGIN_NEEDED
-
#include <newpluginapi.h>
#include <m_langpack.h>
#include <m_skin.h>
@@ -29,6 +27,13 @@ Copyright (C) 2010, 2011 tico-tico #define ModuleName LPGEN("BASS Interface")
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(ModuleName)
+ {}
+};
+
#define OPT_VOLUME "Volume"
#define OPT_BASSPATH "PathToDll"
#define OPT_MAXCHAN "MaxChannels"
|