diff options
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r-- | protocols/Discord/src/main.cpp | 26 | ||||
-rw-r--r-- | protocols/Discord/src/proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Discord/src/stdafx.h | 1 |
3 files changed, 15 insertions, 14 deletions
diff --git a/protocols/Discord/src/main.cpp b/protocols/Discord/src/main.cpp index 3b50bc946b..c0c06bb5cc 100644 --- a/protocols/Discord/src/main.cpp +++ b/protocols/Discord/src/main.cpp @@ -17,20 +17,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" -CMPlugin g_plugin; CHAT_MANAGER *pci; -HINSTANCE g_hInstance; int hLangpack = 0; HWND g_hwndHeartbeat; -extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain; - -IconItem g_iconList[] = -{ - { LPGEN("Main icon"), "main", IDI_MAIN }, - { LPGEN("Group chats"), "groupchat", IDI_GROUPCHAT } -}; - PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -44,12 +34,18 @@ PLUGININFOEX pluginInfo = { { 0x88928401, 0x2ce8, 0x4568, { 0xaa, 0xa7, 0x22, 0x61, 0x41, 0x87, 0x0c, 0xbf } } }; - extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfo; } ///////////////////////////////////////////////////////////////////////////////////////// + +CMPlugin g_plugin; + +extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain; + +///////////////////////////////////////////////////////////////////////////////////////// // Interface information extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; @@ -57,6 +53,12 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC ///////////////////////////////////////////////////////////////////////////////////////// // Load +IconItem g_iconList[] = +{ + { LPGEN("Main icon"), "main", IDI_MAIN }, + { LPGEN("Group chats"), "groupchat", IDI_GROUPCHAT } +}; + extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); @@ -64,7 +66,7 @@ extern "C" int __declspec(dllexport) Load(void) g_hwndHeartbeat = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr); - Icon_Register(g_hInstance, "Discord", g_iconList, _countof(g_iconList)); + Icon_Register(g_plugin.getInst(), "Discord", g_iconList, _countof(g_iconList)); return 0; } diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index c3cd1eda57..f15f31bb1b 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -164,7 +164,7 @@ static INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa HWND CDiscordProto::CreateExtendedSearchUI(HWND hwndParent) { if (hwndParent) - return CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_EXTSEARCH), hwndParent, AdvancedSearchDlgProc, 0); + return CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_EXTSEARCH), hwndParent, AdvancedSearchDlgProc, 0); return nullptr; } diff --git a/protocols/Discord/src/stdafx.h b/protocols/Discord/src/stdafx.h index 5c83a50ef0..76a0d44862 100644 --- a/protocols/Discord/src/stdafx.h +++ b/protocols/Discord/src/stdafx.h @@ -44,7 +44,6 @@ #include "../../libs/zlib/src/zlib.h" extern IconItem g_iconList[]; -extern HINSTANCE g_hInstance; extern HWND g_hwndHeartbeat; #define DB_KEY_ID "id" |