summaryrefslogtreecommitdiff
path: root/plugins/WinterSpeak/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-17 17:09:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-17 17:09:50 +0300
commitbce8bc74daf1c5f510404c8bdf956b41fb1c10fc (patch)
tree9879ad5ce5f42087558601af6a6f2827d7df4c39 /plugins/WinterSpeak/src/main.cpp
parentba1083b4da33ca44a5ae7d90eabbe3d6d340a81e (diff)
WinterSpeak, WhoUsesMyFiles, WhenWasIt, wbOSD, Watrack_MPD -> CMPlugin
Diffstat (limited to 'plugins/WinterSpeak/src/main.cpp')
-rw-r--r--plugins/WinterSpeak/src/main.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp
index 34b0c95268..cbe678d4c1 100644
--- a/plugins/WinterSpeak/src/main.cpp
+++ b/plugins/WinterSpeak/src/main.cpp
@@ -1,8 +1,7 @@
#include "stdafx.h"
-HINSTANCE g_hInst;
+CMPlugin g_plugin;
int hLangpack;
-DWORD g_mirandaVersion;
SpeakConfig *g_speak_config = nullptr;
SpeakAnnounce *g_speak_announce = nullptr;
@@ -24,6 +23,11 @@ PLUGININFOEX pluginInfo={
{ 0x81e189dc, 0xc251, 0x45f6, { 0x9e, 0xdf, 0xa0, 0xf3, 0xa0, 0x5c, 0x42, 0x48 } }
};
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfo;
+}
+
//-----------------------------------------------------------------------------
// Description : External hook
//-----------------------------------------------------------------------------
@@ -68,7 +72,7 @@ int protocolAck(WPARAM, LPARAM lParam)
int dialogOptionsInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_hInst;
+ odp.hInstance = g_plugin.getInst();
odp.szGroup.w = LPGENW("Speak");
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
@@ -95,11 +99,7 @@ int dialogOptionsInitialise(WPARAM wParam, LPARAM)
return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
-{
- g_mirandaVersion = mirandaVersion;
- return &pluginInfo;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Load(void)
{
@@ -107,7 +107,7 @@ extern "C" __declspec(dllexport) int Load(void)
if (!g_speak_config)
{
- g_speak_config = new SpeakConfig(g_hInst);
+ g_speak_config = new SpeakConfig(g_plugin.getInst());
// expose to allow miranda + plugins to access my speak routines
CreateServiceFunction(MS_SPEAK_STATUS, status);
@@ -116,7 +116,7 @@ extern "C" __declspec(dllexport) int Load(void)
if (!g_speak_announce)
{
- g_speak_announce = new SpeakAnnounce(g_hInst);
+ g_speak_announce = new SpeakAnnounce(g_plugin.getInst());
// tap into contact setting change event
g_event_status_change = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, eventStatusChange);
@@ -135,6 +135,8 @@ extern "C" __declspec(dllexport) int Load(void)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
UnhookEvent(g_dialog_options_initialise);
@@ -157,10 +159,3 @@ extern "C" __declspec(dllexport) int Unload(void)
return 0;
}
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- DisableThreadLibraryCalls(hinstDLL);
- g_hInst = hinstDLL;
- return TRUE;
-} \ No newline at end of file