summaryrefslogtreecommitdiff
path: root/plugins/YAPP/src/yapp.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-17 16:47:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-17 16:47:04 +0300
commitba1083b4da33ca44a5ae7d90eabbe3d6d340a81e (patch)
treeff215cbcb7d606f9898dbb0f038e850540f52e75 /plugins/YAPP/src/yapp.cpp
parent3c641c02b973483e86b9562088719396bbdbe412 (diff)
XSoundNotify, YAPP, YaRelay, ZeroSwitch, ZeroNotify -> CMPlugin
Diffstat (limited to 'plugins/YAPP/src/yapp.cpp')
-rw-r--r--plugins/YAPP/src/yapp.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp
index abf01aeb67..c00ce0989c 100644
--- a/plugins/YAPP/src/yapp.cpp
+++ b/plugins/YAPP/src/yapp.cpp
@@ -3,7 +3,7 @@
#include "stdafx.h"
-HMODULE hInst = nullptr;
+CMPlugin g_plugin;
bool bShutdown = false;
MNOTIFYLINK *notifyLink = nullptr;
@@ -28,7 +28,10 @@ HANDLE hTTButton;
// menu items
HGENMENU hMenuRoot, hMenuItem, hMenuItemHistory;
-PLUGININFOEX pluginInfo={
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfo =
+{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -41,18 +44,14 @@ PLUGININFOEX pluginInfo={
{0xefd15f16, 0x7ae4, 0x40d7, {0xa8, 0xe3, 0xa4, 0x11, 0xed, 0x74, 0x7b, 0xd5}}
};
-BOOL WINAPI DllMain(HMODULE hModule, DWORD, LPVOID)
-{
- hInst = hModule;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
-int ReloadFont(WPARAM, LPARAM)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static int ReloadFont(WPARAM, LPARAM)
{
LOGFONT log_font;
if (hFontFirstLine) DeleteObject(hFontFirstLine);
@@ -72,7 +71,7 @@ int ReloadFont(WPARAM, LPARAM)
return 0;
}
-int TTBLoaded(WPARAM, LPARAM)
+static int TTBLoaded(WPARAM, LPARAM)
{
TTBButton ttb = {};
ttb.pszService = "Popup/EnableDisableMenuCommand";
@@ -163,7 +162,7 @@ static void InitFonts()
ReloadFont(0, 0);
}
-void InitMenuItems(void)
+static void InitMenuItems(void)
{
bool isEnabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) == 1;
@@ -187,7 +186,7 @@ void InitMenuItems(void)
hMenuItem = Menu_AddMainMenuItem(&mi);
}
-int ModulesLoaded(WPARAM, LPARAM)
+static int ModulesLoaded(WPARAM, LPARAM)
{
MNotifyGetLink();
@@ -205,7 +204,7 @@ int ModulesLoaded(WPARAM, LPARAM)
return 0;
}
-int PreShutdown(WPARAM, LPARAM)
+static int PreShutdown(WPARAM, LPARAM)
{
bShutdown = true;
DeinitMessagePump();
@@ -229,6 +228,8 @@ extern "C" int __declspec(dllexport) Load(void)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload()
{
DeleteObject(hFontFirstLine);