summaryrefslogtreecommitdiff
path: root/plugins/HistorySweeperLight
diff options
context:
space:
mode:
authorMataes <mataes2007@gmail.com>2018-05-16 22:58:35 +0300
committerMataes <mataes2007@gmail.com>2018-05-16 22:58:35 +0300
commit56239fcddd46400d812d83e38597d593b5c0356d (patch)
tree9e8d35c9a990c2ff6b687ca53065d0c5a4bd3ac1 /plugins/HistorySweeperLight
parent650fc5a2103cedfe149500ade9c684ecf381d348 (diff)
HistoryLinkList, HistoryStats, historysweeperlight, httpserver, HwHotKeys: cmplugin adaptation
Diffstat (limited to 'plugins/HistorySweeperLight')
-rw-r--r--plugins/HistorySweeperLight/src/historysweeperlight.cpp2
-rw-r--r--plugins/HistorySweeperLight/src/main.cpp9
-rw-r--r--plugins/HistorySweeperLight/src/options.cpp6
-rw-r--r--plugins/HistorySweeperLight/src/stdafx.h12
4 files changed, 13 insertions, 16 deletions
diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp
index e73fb24e0c..176a87087e 100644
--- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp
+++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp
@@ -169,7 +169,7 @@ void SweepHistoryFromContact(MCONTACT hContact, CriteriaStruct Criteria, BOOL ke
item = (BEventData*)bsearch(&ev, books, bookcnt, sizeof(BEventData), CompareBookmarks);
if (item != nullptr && item->Timestamp == dbei.timestamp) {
doDelete = FALSE;
- btshift = (--bookcnt - (item - books))*sizeof(BEventData);
+ btshift = (--bookcnt - (item - books)) * sizeof(BEventData);
if (btshift)
memmove(item, item + 1, btshift);
}
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp
index e0fee84c71..84937354a5 100644
--- a/plugins/HistorySweeperLight/src/main.cpp
+++ b/plugins/HistorySweeperLight/src/main.cpp
@@ -21,8 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-HINSTANCE hInst;
-
+CMPlugin g_plugin;
int hLangpack;
LIST<void> g_hWindows(5, PtrKeySortT);
@@ -41,12 +40,6 @@ static PLUGININFOEX pluginInfoEx =
{ 0x1d9bf74a, 0x44a8, 0x4b3f, { 0xa6, 0xe5, 0x73, 0x6, 0x9d, 0x3a, 0x89, 0x79 } }
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInst = hinstDLL;
- return TRUE;
-}
-
int OnIconPressed(WPARAM hContact, LPARAM lParam)
{
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp
index b6826d4c57..af1f911fb9 100644
--- a/plugins/HistorySweeperLight/src/options.cpp
+++ b/plugins/HistorySweeperLight/src/options.cpp
@@ -56,7 +56,7 @@ static HANDLE hIconLibItem[_countof(iconList)];
void InitIcons(void)
{
- Icon_Register(hInst, ModuleName, iconList, _countof(iconList), ModuleName);
+ Icon_Register(g_plugin.getInst(), ModuleName, iconList, _countof(iconList), ModuleName);
}
HICON LoadIconEx(const char* name)
@@ -228,7 +228,7 @@ INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
return TRUE;
case WM_NOTIFY:
- NMCLISTCONTROL *nmc = (NMCLISTCONTROL*)lParam;
+ NMCLISTCONTROL * nmc = (NMCLISTCONTROL*)lParam;
if (nmc->hdr.idFrom == 0 && nmc->hdr.code == (unsigned)PSN_APPLY)
SaveSettings(hwndDlg);
else if (nmc->hdr.idFrom == IDC_LIST) {
@@ -270,7 +270,7 @@ INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
int HSOptInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = hInst;
+ odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HISTORYSWEEPER);
odp.szTitle.a = ModuleName;
odp.szGroup.a = LPGEN("History");
diff --git a/plugins/HistorySweeperLight/src/stdafx.h b/plugins/HistorySweeperLight/src/stdafx.h
index 1293f4ad9f..27d77a69d2 100644
--- a/plugins/HistorySweeperLight/src/stdafx.h
+++ b/plugins/HistorySweeperLight/src/stdafx.h
@@ -22,14 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define __HISTORYSWEEPERLIGHT_H__
#if !defined( _WIN64 )
- #define _USE_32BIT_TIME_T
+#define _USE_32BIT_TIME_T
#endif
#include <windows.h>
#include <time.h>
-#define __NO_CMPLUGIN_NEEDED
-
#include <win2k.h>
#include <newpluginapi.h>
#include <m_database.h>
@@ -46,8 +44,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Plugin name
#define ModuleName "History Sweeper Light"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(ModuleName)
+ {}
+};
+
// main.c
-extern HINSTANCE hInst;
extern LIST<void> g_hWindows;
// options.c