summaryrefslogtreecommitdiff
path: root/plugins/SeenPlugin/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SeenPlugin/src')
-rw-r--r--plugins/SeenPlugin/src/history.cpp2
-rw-r--r--plugins/SeenPlugin/src/main.cpp31
-rw-r--r--plugins/SeenPlugin/src/missed.cpp2
-rw-r--r--plugins/SeenPlugin/src/options.cpp2
-rw-r--r--plugins/SeenPlugin/src/stdafx.h14
-rw-r--r--plugins/SeenPlugin/src/userinfo.cpp2
6 files changed, 30 insertions, 23 deletions
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp
index fb0f4f4e12..75b5002c6d 100644
--- a/plugins/SeenPlugin/src/history.cpp
+++ b/plugins/SeenPlugin/src/history.cpp
@@ -284,7 +284,7 @@ void ShowHistory(MCONTACT hContact, BYTE isAlert)
{
HWND hHistoryDlg = WindowList_Find(hWindowList, hContact);
if (hHistoryDlg == nullptr) {
- hHistoryDlg = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_HISTORY), nullptr, HistoryDlgProc, hContact);
+ hHistoryDlg = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_HISTORY), nullptr, HistoryDlgProc, hContact);
LoadHistoryList(hContact, hHistoryDlg, IDC_HISTORYLIST);
WindowList_Add(hWindowList, hHistoryDlg, hContact);
}
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp
index 7491080adf..314bb9860f 100644
--- a/plugins/SeenPlugin/src/main.cpp
+++ b/plugins/SeenPlugin/src/main.cpp
@@ -20,14 +20,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-HINSTANCE hInstance;
HANDLE ehmissed = nullptr, ehuserinfo = nullptr, ehmissed_proto = nullptr;
HANDLE g_hShutdownEvent;
MWindowList g_pUserInfo;
int hLangpack;
+CMPlugin g_plugin;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfo =
+{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -37,9 +40,16 @@ PLUGININFOEX pluginInfo = {
__AUTHORWEB,
UNICODE_AWARE,
// {2D506D46-C94E-4EF8-8537-F11233A80381}
- { 0x2d506d46, 0xc94e, 0x4ef8, { 0x85, 0x37, 0xf1, 0x12, 0x33, 0xa8, 0x03, 0x81 } }
+ { 0x2d506d46, 0xc94e, 0x4ef8, { 0x85, 0x37, 0xf1, 0x12, 0x33, 0xa8, 0x03, 0x81 }}
};
+extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD)
+{
+ return &pluginInfo;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
#define TRANSNUMBER 2
DBVTranslation idleTr[TRANSNUMBER] = {
{ any_to_IdleNotidleUnknown, L"Any to Idle/Not Idle/Unknown", 0 },
@@ -57,7 +67,9 @@ mir_cs csContacts;
void UninitHistoryDialog(void);
-int MainInit(WPARAM, LPARAM)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static int MainInit(WPARAM, LPARAM)
{
if (g_bFileActive = db_get_b(NULL, S_MOD, "FileOutput", 0))
InitFileOutput();
@@ -108,10 +120,7 @@ extern "C" __declspec(dllexport) int Load(void)
return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD)
-{
- return &pluginInfo;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
extern "C" __declspec(dllexport) int Unload(void)
{
@@ -127,9 +136,3 @@ extern "C" __declspec(dllexport) int Unload(void)
UninitHistoryDialog();
return 0;
}
-
-BOOL WINAPI DllMain(HINSTANCE hinst, DWORD, LPVOID)
-{
- hInstance = hinst;
- return 1;
-}
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp
index 15fd50725d..aef95a6350 100644
--- a/plugins/SeenPlugin/src/missed.cpp
+++ b/plugins/SeenPlugin/src/missed.cpp
@@ -114,7 +114,7 @@ int ShowMissed(void)
buf.AppendChar('\n');
}
- CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_MISSED), nullptr, MissedDlgProc, (LPARAM)buf.c_str());
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_MISSED), nullptr, MissedDlgProc, (LPARAM)buf.c_str());
return 0;
}
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp
index 4b4882d5d6..46d9c8b8c6 100644
--- a/plugins/SeenPlugin/src/options.cpp
+++ b/plugins/SeenPlugin/src/options.cpp
@@ -488,7 +488,7 @@ int OptionsInit(WPARAM wparam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
- odp.hInstance = hInstance;
+ odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETTINGS);
odp.szGroup.w = LPGENW("Contacts");
diff --git a/plugins/SeenPlugin/src/stdafx.h b/plugins/SeenPlugin/src/stdafx.h
index f3affdc167..9d91ee93ad 100644
--- a/plugins/SeenPlugin/src/stdafx.h
+++ b/plugins/SeenPlugin/src/stdafx.h
@@ -31,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <malloc.h>
#include <time.h>
-#define __NO_CMPLUGIN_NEEDED
#include <win2k.h>
#include <newpluginapi.h>
#include <m_database.h>
@@ -55,13 +54,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "resource.h"
#include "version.h"
-WCHAR *any_to_IdleNotidleUnknown(MCONTACT hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen);
-WCHAR *any_to_Idle(MCONTACT hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen);
+wchar_t *any_to_IdleNotidleUnknown(MCONTACT hContact, const char *module_name, const char *setting_name, wchar_t *buff, int bufflen);
+wchar_t *any_to_Idle(MCONTACT hContact, const char *module_name, const char *setting_name, wchar_t *buff, int bufflen);
#define NUM100NANOSEC 116444736000000000
#define S_MOD "SeenModule"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(S_MOD)
+ {}
+};
+
//#define UM_CHECKHOOKS (WM_USER+1)
#define debug(a) MessageBox(NULL,a,L"Debug",MB_OK)
@@ -105,7 +111,6 @@ int UserinfoInit(WPARAM,LPARAM);
void InitMenuitem(void);
int UpdateValues(WPARAM, LPARAM);
int ModeChange(WPARAM,LPARAM);
-void SetOffline(void);
int ModeChange_mo(WPARAM,LPARAM);
int CheckIfOnline(void);
void ShowHistory(MCONTACT hContact, BYTE isAlert);
@@ -120,7 +125,6 @@ struct logthread_info
WORD currStatus;
};
-extern HINSTANCE hInstance;
extern DWORD StatusColors15bits[];
extern BOOL includeIdle;
extern HANDLE ehmissed, ehuserinfo, ehmissed_proto;
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp
index 19d2aebd16..dbfa5232fb 100644
--- a/plugins/SeenPlugin/src/userinfo.cpp
+++ b/plugins/SeenPlugin/src/userinfo.cpp
@@ -70,7 +70,7 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam)
if (IsWatchedProtocol(szProto) && !db_get_b(hContact, szProto, "ChatRoom", false)) {
OPTIONSDIALOGPAGE uip = { sizeof(uip) };
- uip.hInstance = hInstance;
+ uip.hInstance = g_plugin.getInst();
uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
uip.szTitle.a = LPGEN("Last seen");
uip.pfnDlgProc = UserinfoDlgProc;