summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker/src/spellchecker.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-17 18:23:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-17 18:23:34 +0300
commit2aa59179945482dee30935c991f9317dfbf31946 (patch)
tree49fc2b77d68b636c7842a1af462af59c94ff6da5 /plugins/SpellChecker/src/spellchecker.cpp
parent4c4735a232c680e60a85d0f85e2cb392e012c6e0 (diff)
Tipper, StopSpamMod, StopSpam, StatusManager, StatusChange, StartupSilence, StartPosition, SplashScreen, SpellChecker, Spamotron => CMPlugin
Diffstat (limited to 'plugins/SpellChecker/src/spellchecker.cpp')
-rw-r--r--plugins/SpellChecker/src/spellchecker.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp
index 9770861c9c..276c2b650c 100644
--- a/plugins/SpellChecker/src/spellchecker.cpp
+++ b/plugins/SpellChecker/src/spellchecker.cpp
@@ -21,22 +21,8 @@ Boston, MA 02111-1307, USA.
// Prototypes ///////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- __DESCRIPTION,
- __AUTHOR,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- // {36753AE3-840B-4797-94A5-FD9F5852B942}
- { 0x36753ae3, 0x840b, 0x4797, { 0x94, 0xa5, 0xfd, 0x9f, 0x58, 0x52, 0xb9, 0x42 } }
-};
-
-HINSTANCE hInst;
-
int hLangpack = 0;
+CMPlugin g_plugin;
HANDLE hDictionariesFolder = nullptr;
wchar_t *dictionariesFolder;
@@ -55,19 +41,29 @@ BOOL loaded = FALSE;
LIST<Dictionary> languages(1);
-// Functions ////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
+PLUGININFOEX pluginInfo =
{
- hInst = hinstDLL;
- return TRUE;
-}
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ // {36753AE3-840B-4797-94A5-FD9F5852B942}
+ { 0x36753ae3, 0x840b, 0x4797, { 0x94, 0xa5, 0xfd, 0x9f, 0x58, 0x52, 0xb9, 0x42 }}
+};
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
+// Functions ////////////////////////////////////////////////////////////////////////////
+
static int IconsChanged(WPARAM, LPARAM)
{
StatusIconData sid = {};
@@ -137,7 +133,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
HMODULE hFlagsDll = LoadLibraryEx(flag_file, nullptr, LOAD_LIBRARY_AS_DATAFILE);
wchar_t path[MAX_PATH];
- GetModuleFileName(hInst, path, MAX_PATH);
+ GetModuleFileName(g_plugin.getInst(), path, MAX_PATH);
SKINICONDESC sid = {};
sid.flags = SIDF_ALL_UNICODE | SIDF_SORTED;
@@ -234,7 +230,7 @@ extern "C" int __declspec(dllexport) Load(void)
mir_getLP(&pluginInfo);
// icons
- Icon_Register(hInst, LPGEN("Spell Checker"), iconList, _countof(iconList));
+ Icon_Register(g_plugin.getInst(), LPGEN("Spell Checker"), iconList, _countof(iconList));
// hooks
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);