summaryrefslogtreecommitdiff
path: root/plugins/MsgPopup/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-17 20:50:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-17 20:50:08 +0300
commit523f3588b6f21adcc4bcf3ec3ffad05e2298863a (patch)
tree428f9611be9bfdba157f5c2056908ee02c9c7ce6 /plugins/MsgPopup/src/main.cpp
parent11e70d8c4e224d80015fffe0378c53abee5fd824 (diff)
KeyboardNotify, ListeningTo, MessageState, MirandaG15, MirFox, Msg_Export, MsgPopup, mTextControl => CMPlugin
Diffstat (limited to 'plugins/MsgPopup/src/main.cpp')
-rw-r--r--plugins/MsgPopup/src/main.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp
index cc39c0653e..f35ce90daa 100644
--- a/plugins/MsgPopup/src/main.cpp
+++ b/plugins/MsgPopup/src/main.cpp
@@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-HINSTANCE hInst;
int hLangpack;
+CMPlugin g_plugin;
MSGBOXOPTIONS optionsDefault =
{
@@ -34,7 +34,10 @@ MSGBOXOPTIONS optionsDefault =
};
MSGBOXOPTIONS options;
-PLUGININFOEX pluginInfo={
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfo =
+{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -47,6 +50,13 @@ PLUGININFOEX pluginInfo={
{0xcf25d645, 0x4dab, 0x4b0a, {0xb9, 0xf1, 0xde, 0x1e, 0x86, 0x23, 0x1f, 0x9b}}
};
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfo;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
typedef int (WINAPI *MSGBOXPROC)(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);
MSGBOXPROC prevMessageBox;
@@ -183,7 +193,7 @@ int HookedOptions(WPARAM wParam, LPARAM)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = hInst;
+ odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.w = LPGENW("MessagePopup");
odp.szGroup.w = LPGENW("Popups");
@@ -209,6 +219,8 @@ void LoadConfig()
options.Sound = db_get_b(NULL, SERVICENAME, "Sound", (DWORD)optionsDefault.Sound);
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfo);
@@ -219,18 +231,9 @@ extern "C" __declspec(dllexport) int Load(void)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
return 0;
}
-
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInst = hinstDLL;
- return TRUE;
-}