diff options
| author | George Hazan <ghazan@miranda.im> | 2018-05-17 21:05:17 +0300 |
|---|---|---|
| committer | George Hazan <ghazan@miranda.im> | 2018-05-17 21:05:23 +0300 |
| commit | 5ebe9c34375bce857ad3160abba67d6ed2beadaf (patch) | |
| tree | 6ec4260f751125db66852d70aed8e106a2527012 /plugins/MirLua/src/main.cpp | |
| parent | 754665d1ae053678088144bb833bda76a0d95794 (diff) | |
MirLua, MirOTR, New_GPG, OpenSSL, SecureIM -> CMplugin
Diffstat (limited to 'plugins/MirLua/src/main.cpp')
| -rw-r--r-- | plugins/MirLua/src/main.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp index cee700e68b..31c5d93912 100644 --- a/plugins/MirLua/src/main.cpp +++ b/plugins/MirLua/src/main.cpp @@ -1,8 +1,7 @@ #include "stdafx.h"
int hLangpack;
-
-HINSTANCE g_hInstance;
+CMPlugin g_plugin;
CMLua *g_mLua;
@@ -11,6 +10,8 @@ HANDLE g_hScriptsFolder; HNETLIBUSER hNetlib = nullptr;
+/////////////////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfo =
{
sizeof(PLUGININFOEX),
@@ -26,29 +27,23 @@ PLUGININFOEX pluginInfo = };
-DWORD WINAPI DllMain(HINSTANCE hInstance, DWORD, LPVOID)
-{
- g_hInstance = hInstance;
-
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
int OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {};
- odp.hInstance = g_hInstance;
+ odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.szGroup.w = LPGENW("Services");
odp.szTitle.w = L"Lua";
odp.szTab.w = LPGENW("Scripts");
odp.pDialog = new CMLuaOptions(g_mLua);
Options_AddPage(wParam, &odp);
-
return 0;
}
@@ -58,7 +53,6 @@ int OnModulesLoaded(WPARAM, LPARAM) g_hScriptsFolder = FoldersRegisterCustomPathT(MODULE, "ScriptsFolder", MIRLUA_PATHT, TranslateT("Scripts folder"));
HookEvent(ME_OPT_INITIALISE, OnOptionsInit);
-
return 0;
}
@@ -83,10 +77,11 @@ extern "C" int __declspec(dllexport) Load(void) g_mLua->Load();
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
-
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
delete g_mLua;
|
