diff options
author | Mataes <mataes2007@gmail.com> | 2018-05-16 21:48:52 +0300 |
---|---|---|
committer | Mataes <mataes2007@gmail.com> | 2018-05-16 21:49:13 +0300 |
commit | 650fc5a2103cedfe149500ade9c684ecf381d348 (patch) | |
tree | a7f4727baa7b298992a65d240a6017dda3a82f9a /plugins/FingerprintNG/src | |
parent | f1195d51ea8094492fcf63a301f2cdc9d1173d6c (diff) |
FavContacts, FileAsMessage, Fingerprint, FloatingContacts, Folders, FTPFile: cmplugin adaptation
Diffstat (limited to 'plugins/FingerprintNG/src')
-rw-r--r-- | plugins/FingerprintNG/src/fingerprint.cpp | 8 | ||||
-rw-r--r-- | plugins/FingerprintNG/src/main.cpp | 8 | ||||
-rw-r--r-- | plugins/FingerprintNG/src/options.cpp | 4 | ||||
-rw-r--r-- | plugins/FingerprintNG/src/stdafx.h | 10 |
4 files changed, 14 insertions, 16 deletions
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 336044be94..723c12d8be 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -65,7 +65,7 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable) wchar_t destfile[MAX_PATH]; if (mask->iIconIndex == IDI_NOTFOUND || mask->iIconIndex == IDI_UNKNOWN || mask->iIconIndex == IDI_UNDETECTED) - GetModuleFileName(g_hInst, destfile, MAX_PATH); + GetModuleFileName(g_plugin.getInst(), destfile, MAX_PATH); else { wcsncpy_s(destfile, g_szSkinLib, _TRUNCATE); @@ -419,9 +419,9 @@ HICON __fastcall CreateIconFromIndexes(short base, short overlay, short overlay2 * Futher routines is for creating joined 'overlay' icons. ******************************************************************************/ -/* -* CreateBitmap32 - Create DIB 32 bitmap with sizes cx*cy -*/ + /* + * CreateBitmap32 - Create DIB 32 bitmap with sizes cx*cy + */ HBITMAP __inline CreateBitmap32(int cx, int cy) { diff --git a/plugins/FingerprintNG/src/main.cpp b/plugins/FingerprintNG/src/main.cpp index a6ffebc4b2..9859de14ca 100644 --- a/plugins/FingerprintNG/src/main.cpp +++ b/plugins/FingerprintNG/src/main.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define LIB_REG 2
#define LIB_USE 3
-HINSTANCE g_hInst;
+CMPlugin g_plugin;
int hLangpack;
HANDLE hHeap = nullptr;
@@ -44,12 +44,6 @@ PLUGININFOEX pluginInfoEx = { { 0x687364af, 0x58b0, 0x4af2, { 0xa4, 0xee, 0x20, 0xf4, 0xa, 0x8d, 0x9a, 0xfb } }
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- g_hInst = hinstDLL;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp index 388a9e7175..18ee7372bd 100644 --- a/plugins/FingerprintNG/src/options.cpp +++ b/plugins/FingerprintNG/src/options.cpp @@ -93,7 +93,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case WM_NOTIFY:
- NMHDR *hdr = (NMHDR *)lParam;
+ NMHDR * hdr = (NMHDR *)lParam;
if (hdr && hdr->code == PSN_APPLY) {
for (auto &it : settings)
StoreDBCheckState(hwndDlg, it.idCtrl, it.szSetName);
@@ -112,7 +112,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP int OnOptInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_hInst;
+ odp.hInstance = g_plugin.getInst();
odp.szGroup.w = LPGENW("Icons");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG);
odp.szTitle.w = LPGENW("Fingerprint");
diff --git a/plugins/FingerprintNG/src/stdafx.h b/plugins/FingerprintNG/src/stdafx.h index 822017b095..41a6a0a683 100644 --- a/plugins/FingerprintNG/src/stdafx.h +++ b/plugins/FingerprintNG/src/stdafx.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <malloc.h>
// Miranda IM SDK includes
-#define __NO_CMPLUGIN_NEEDED
#include <newpluginapi.h>
#include <win2k.h>
#include <m_database.h>
@@ -113,6 +112,13 @@ typedef struct _foundInfo #define DEFAULT_SKIN_FOLDER L"Icons\\Fp_icons.dll"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME)
+ {}
+};
+
void ClearFI();
void InitFingerModule(void);
@@ -127,13 +133,11 @@ HANDLE __fastcall GetIconIndexFromFI(LPTSTR szMirVer); BOOL __fastcall WildCompareW(LPWSTR name, LPWSTR mask);
-void __fastcall Prepare(KN_FP_MASK* mask);
void RegisterIcons();
#define WildCompare WildCompareW
#define GetIconsIndexes GetIconsIndexesW
-extern HINSTANCE g_hInst;
extern HANDLE hHeap;
extern KN_FP_MASK
|