diff options
author | Mataes <mataes2007@gmail.com> | 2018-05-16 21:12:31 +0300 |
---|---|---|
committer | Mataes <mataes2007@gmail.com> | 2018-05-16 21:12:31 +0300 |
commit | 1fc8e65dd319abf0bac6ce753bb87ecbabd8b177 (patch) | |
tree | 94aaf74e14515883aea9da6752ccacca6007fa47 /plugins/CSList | |
parent | aba882ecf1f570400c301493725fcb31270e0fd5 (diff) |
Flags, CrashDumper, CryptoPP, CSList, Db_autobackups, DbEditorPP: cmplugin adaptation
Diffstat (limited to 'plugins/CSList')
-rw-r--r-- | plugins/CSList/src/cslist.cpp | 26 | ||||
-rw-r--r-- | plugins/CSList/src/stdafx.h | 11 |
2 files changed, 16 insertions, 21 deletions
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 092bc18f5e..e224226ad1 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "strpos.h" CLIST_INTERFACE *pcli; +CMPlugin g_plugin; int hLangpack; -HINSTANCE g_hInst; static LIST<CSWindow> arWindows(3, HandleKeySortT); @@ -47,14 +47,6 @@ PLUGININFOEX pluginInfoEx = { 0xc8cc7414, 0x6507, 0x4af6, { 0x92, 0x5a, 0x83, 0xc1, 0xd2, 0xf7, 0xbe, 0x8c } } }; -// ====[ MAIN ]=============================================================== - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) -{ - g_hInst = hinstDLL; - return TRUE; -} - // ====[ PLUGIN INFO ]======================================================== extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) @@ -81,7 +73,7 @@ static int OnInitOptions(WPARAM wparam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; odp.position = 955000000; - odp.hInstance = g_hInst; + odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pfnDlgProc = CSOptionsProc; odp.szGroup.w = L"Status"; @@ -120,7 +112,7 @@ extern "C" __declspec(dllexport) int Load() // init icons wchar_t tszFile[MAX_PATH]; - GetModuleFileName(g_hInst, tszFile, MAX_PATH); + GetModuleFileName(g_plugin.getInst(), tszFile, MAX_PATH); SKINICONDESC sid = {}; sid.defaultFile.w = tszFile; @@ -212,7 +204,7 @@ INT_PTR showList(WPARAM, LPARAM, LPARAM param) } } - CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CSLIST), nullptr, CSWindowProc, (LPARAM)new CSWindow(szProto)); + CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CSLIST), nullptr, CSWindowProc, (LPARAM)new CSWindow(szProto)); return 0; } @@ -232,7 +224,7 @@ void addProtoStatusMenuItem(char *protoName) CreateServiceFunctionParam(buf, showList, (LPARAM)protoName); CMenuItem mi; - mi.flags = CMIF_UNICODE; + mi.flags = CMIF_UNICODE; mi.hIcolibItem = forms[0].hIcoLibItem; mi.name.w = MODULENAME; mi.position = 2000040000; @@ -458,7 +450,7 @@ CSAMWindow::~CSAMWindow() void CSAMWindow::exec() { - DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_ADDMODIFY), nullptr, CSAMWindowProc, (LPARAM)this); + DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_ADDMODIFY), nullptr, CSAMWindowProc, (LPARAM)this); } @@ -1002,15 +994,15 @@ INT_PTR CALLBACK CSOptionsProc(HWND hwnd, UINT message, WPARAM, LPARAM lparam) TranslateDialogDefault(hwnd); CheckDlgButton(hwnd, IDC_CONFIRM_DELETION, getByte("ConfirmDeletion", DEFAULT_PLUGIN_CONFIRM_ITEMS_DELETION) ? - BST_CHECKED : BST_UNCHECKED); + BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwnd, IDC_DELETE_AFTER_IMPORT, getByte("DeleteAfterImport", DEFAULT_PLUGIN_DELETE_AFTER_IMPORT) ? - BST_CHECKED : BST_UNCHECKED); + BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwnd, IDC_REMEMBER_POSITION, getByte("RememberWindowPosition", DEFAULT_REMEMBER_WINDOW_POSITION) ? - BST_CHECKED : BST_UNCHECKED); + BST_CHECKED : BST_UNCHECKED); return TRUE; case WM_NOTIFY: diff --git a/plugins/CSList/src/stdafx.h b/plugins/CSList/src/stdafx.h index 6dbe1bfcbd..810409e9fa 100644 --- a/plugins/CSList/src/stdafx.h +++ b/plugins/CSList/src/stdafx.h @@ -35,8 +35,6 @@ Offers List of your Custom Statuses. #include <windows.h>
-#define __NO_CMPLUGIN_NEEDED
-
#include <newpluginapi.h>
#include <m_database.h>
#include <m_system.h>
@@ -59,6 +57,13 @@ Offers List of your Custom Statuses. #define MODULENAME LPGENW("Custom Status List")
#define MODNAME "CSList"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(MODNAME)
+ {}
+};
+
// ====[ LIMITS ]=============================================================
#define EXTRASTATUS_TITLE_LIMIT 64 // limit of chars for extra status title
@@ -396,7 +401,6 @@ INT_PTR __cdecl showList(WPARAM, LPARAM, LPARAM); void addProtoStatusMenuItem(char *protoName);
// other functions
-void IitIcoLib();
void RegisterHotkeys(char buf[200], wchar_t* accName, int Number);
void SetStatus(WORD code, StatusItem* item, char *protoName);
@@ -404,7 +408,6 @@ void SetStatus(WORD code, StatusItem* item, char *protoName); INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
INT_PTR CALLBACK CSAMWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
-INT_PTR CALLBACK CSRNWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
INT_PTR CALLBACK CSOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
#endif /* __CSLIST_H */
|