summaryrefslogtreecommitdiff
path: root/plugins/ChangeKeyboardLayout/src/main.cpp
diff options
context:
space:
mode:
authorMataes <mataes2007@gmail.com>2018-05-16 19:12:38 +0300
committerMataes <mataes2007@gmail.com>2018-05-16 19:12:38 +0300
commitb12321b9897b511e94301b73c1c48c533412d739 (patch)
treeaeec4c481dc82376e22879e76a81fd2abb7138f5 /plugins/ChangeKeyboardLayout/src/main.cpp
parent3c4beeb99d4324fb453e928421c9b13d70ab4923 (diff)
BossKey, BuddyExpectator, BuddyPounce, ChangeKeyboardLayout, ClientChangeNotify, Cln_skinedit, CmdLine: cmplugin adaptation
Diffstat (limited to 'plugins/ChangeKeyboardLayout/src/main.cpp')
-rw-r--r--plugins/ChangeKeyboardLayout/src/main.cpp18
1 files changed, 6 insertions, 12 deletions
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);