From b12321b9897b511e94301b73c1c48c533412d739 Mon Sep 17 00:00:00 2001 From: Mataes Date: Wed, 16 May 2018 19:12:38 +0300 Subject: BossKey, BuddyExpectator, BuddyPounce, ChangeKeyboardLayout, ClientChangeNotify, Cln_skinedit, CmdLine: cmplugin adaptation --- plugins/ChangeKeyboardLayout/src/main.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'plugins/ChangeKeyboardLayout/src/main.cpp') diff --git a/plugins/ChangeKeyboardLayout/src/main.cpp b/plugins/ChangeKeyboardLayout/src/main.cpp index 5286a2f871..9d53aed4b1 100644 --- a/plugins/ChangeKeyboardLayout/src/main.cpp +++ b/plugins/ChangeKeyboardLayout/src/main.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" +CMPlugin g_plugin; int hLangpack; LPTSTR ptszLayStrings[20]; HANDLE hChangeLayout, hGetLayoutOfText, hChangeTextLayout; HICON hPopupIcon, hCopyIcon; HKL hklLayouts[20]; BYTE bLayNum; -HINSTANCE hInst; HHOOK kbHook_All; MainOptions moOptions; PopupOptions poOptions, poOptionsTemp; @@ -31,12 +31,6 @@ LPCTSTR ptszSeparators = L" \t\n\r"; HANDLE hOptionsInitialize; -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) -{ - hInst = hinstDLL; - return TRUE; -} - extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; @@ -49,18 +43,18 @@ static IconItem iconList[] = }; extern "C" __declspec(dllexport) int Load(void) -{ +{ mir_getLP(&pluginInfoEx); memset(hklLayouts, 0, sizeof(hklLayouts)); bLayNum = GetKeyboardLayoutList(20, hklLayouts); - if (bLayNum < 2) + if (bLayNum < 2) return 1; - + HookEvent(ME_OPT_INITIALISE, OnOptionsInitialise); HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); // IcoLib support - Icon_Register(hInst, ModuleName, iconList, _countof(iconList)); + Icon_Register(g_plugin.getInst(), ModuleName, iconList, _countof(iconList)); HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged); @@ -71,7 +65,7 @@ extern "C" __declspec(dllexport) int Load(void) extern "C" __declspec(dllexport) int Unload(void) { - for (int i = 0; i < bLayNum; i++) + for (int i = 0; i < bLayNum; i++) mir_free(ptszLayStrings[i]); DestroyServiceFunction(hChangeLayout); -- cgit v1.2.3