diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-16 13:42:19 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-16 13:42:25 +0300 |
commit | 51f216f7e0feb67ad21387219c1b90e42b14658d (patch) | |
tree | 2ce37e615bf4f82320fe01babc37401fa4a56ca3 /src/core/stdmsg | |
parent | 2e8582832fe56c89bb422b82e884ddaf67a8dbb3 (diff) |
Core plugins => CMPlugin
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r-- | src/core/stdmsg/src/chat_manager.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_options.cpp | 10 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/globals.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgoptions.cpp | 8 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgtimedout.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/srmm.cpp | 9 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.h | 14 | ||||
-rw-r--r-- | src/core/stdmsg/src/tabs.cpp | 4 |
11 files changed, 29 insertions, 30 deletions
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index fd0bf8cf8a..06ca982f74 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -249,7 +249,7 @@ void Load_ChatModule() oldDoTrayIcon = pci->DoTrayIcon; pci->DoTrayIcon = DoTrayIcon; pci->ReloadSettings(); - g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU)); + g_hMenu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_MENU)); HookEvent(ME_SYSTEM_MODULELOAD, OnCheckPlugins); } diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index 2764e3c528..6f9dcc88db 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -178,8 +178,8 @@ static IconItem iconList[] = void AddIcons(void) { - Icon_Register(g_hInst, LPGEN("Messaging") "/" LPGEN("Group chats"), iconList, 21); - Icon_Register(g_hInst, LPGEN("Messaging") "/" LPGEN("Group chats log"), iconList + 21, 14); + Icon_Register(g_plugin.getInst(), LPGEN("Messaging") "/" LPGEN("Group chats"), iconList, 21); + Icon_Register(g_plugin.getInst(), LPGEN("Messaging") "/" LPGEN("Group chats log"), iconList + 21, 14); } // load icons from the skinning module if available @@ -332,7 +332,7 @@ class COptMainDlg : public CDlgBase public: COptMainDlg() - : CDlgBase(g_hInst, IDD_OPTIONS1), + : CDlgBase(g_plugin.getInst(), IDD_OPTIONS1), checkBoxes(this, IDC_CHECKBOXES) { checkBoxes.OnItemChanged = Callback(this, &COptMainDlg::onChange_Tree); @@ -433,7 +433,7 @@ class COptLogDlg : public CDlgBase public: COptLogDlg() : - CDlgBase(g_hInst, IDD_OPTIONS2), + CDlgBase(g_plugin.getInst(), IDD_OPTIONS2), spin2(this, IDC_SPIN2), spin3(this, IDC_SPIN3), spin4(this, IDC_SPIN4), @@ -596,7 +596,7 @@ class COptPopupDlg : public CDlgBase public: COptPopupDlg() - : CDlgBase(g_hInst, IDD_OPTIONSPOPUP), + : CDlgBase(g_plugin.getInst(), IDD_OPTIONSPOPUP), chkRadio1(this, IDC_RADIO1), chkRadio2(this, IDC_RADIO2), chkRadio3(this, IDC_RADIO3) diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 61600f5619..f6e101eb5f 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -258,7 +258,7 @@ void CChatRoomDlg::ScrollToBottom() void CChatRoomDlg::ShowFilterMenu() { - HWND hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_FILTER), m_hwnd, FilterWndProc, (LPARAM)this); + HWND hwnd = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FILTER), m_hwnd, FilterWndProc, (LPARAM)this); TranslateDialogDefault(hwnd); RECT rc; diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp index 4a3632a363..dd0ab36221 100644 --- a/src/core/stdmsg/src/globals.cpp +++ b/src/core/stdmsg/src/globals.cpp @@ -30,7 +30,7 @@ IconItem iconList[] = static void InitIcons(void)
{
- Icon_Register(g_hInst, LPGEN("Messaging"), iconList, _countof(iconList), "SRMM");
+ Icon_Register(g_plugin.getInst(), LPGEN("Messaging"), iconList, _countof(iconList), "SRMM");
}
static int IconsChanged(WPARAM, LPARAM)
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index d1d63b4562..4750710aaf 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -852,7 +852,7 @@ LRESULT CSrmmWindow::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) mwpd.hContact = m_hContact;
mwpd.hwnd = m_message.GetHwnd();
- HMENU hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT));
+ HMENU hMenu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_CONTEXT));
mwpd.hMenu = GetSubMenu(hMenu, 1);
TranslateMenu(mwpd.hMenu);
@@ -1335,7 +1335,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_RBUTTONUP:
CHARRANGE all = { 0, -1 };
- HMENU hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT));
+ HMENU hMenu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_CONTEXT));
HMENU hSubMenu = GetSubMenu(hMenu, 0);
TranslateMenu(hSubMenu);
SendMessage(((NMHDR *)lParam)->hwndFrom, EM_EXGETSEL, 0, (LPARAM)&sel);
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 6c62b74d07..101c07cf46 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -193,7 +193,7 @@ class COptionMainDlg : public CPluginDlgBase public:
COptionMainDlg() :
- CPluginDlgBase(g_hInst, IDD_OPT_MSGDLG, SRMMMOD),
+ CPluginDlgBase(g_plugin.getInst(), IDD_OPT_MSGDLG, SRMMMOD),
tree(this, IDC_POPLIST),
edtSecs(this, IDC_SECONDS),
edtNFlash(this, IDC_NFLASHES),
@@ -315,7 +315,7 @@ class COptionLogDlg : public CPluginDlgBase public:
COptionLogDlg() :
- CPluginDlgBase(g_hInst, IDD_OPT_MSGLOG, SRMMMOD),
+ CPluginDlgBase(g_plugin.getInst(), IDD_OPT_MSGLOG, SRMMMOD),
chkSecs(this, IDC_SHOWSECS),
chkDate(this, IDC_SHOWDATES),
chkTime(this, IDC_SHOWTIMES),
@@ -418,7 +418,7 @@ class COptionTypingDlg : public CPluginDlgBase public:
COptionTypingDlg() :
- CPluginDlgBase(g_hInst, IDD_OPT_MSGTYPE, SRMMMOD),
+ CPluginDlgBase(g_plugin.getInst(), IDD_OPT_MSGTYPE, SRMMMOD),
clist(this, IDC_CLIST),
chkType(this, IDC_SHOWNOTIFY),
chkTypeWin(this, IDC_TYPEWIN),
@@ -529,7 +529,7 @@ class COptionsTabDlg : public CDlgBase public:
COptionsTabDlg() :
- CDlgBase(g_hInst, IDD_OPT_TABS),
+ CDlgBase(g_plugin.getInst(), IDD_OPT_TABS),
m_chkTabs(this, IDC_USETABS),
m_chkTabsBottom(this, IDC_TABSBOTTOM),
m_chkTabsClose(this, IDC_CLOSETABS),
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index a95501bf69..9b9ad4fe75 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////////////////
CMsgDialog::CMsgDialog(int iDialogId, SESSION_INFO *si)
- : CSuper(g_hInst, iDialogId, si),
+ : CSuper(g_plugin.getInst(), iDialogId, si),
m_btnOk(this, IDOK)
{
m_autoClose = 0;
diff --git a/src/core/stdmsg/src/msgtimedout.cpp b/src/core/stdmsg/src/msgtimedout.cpp index dd63373531..6175957d49 100644 --- a/src/core/stdmsg/src/msgtimedout.cpp +++ b/src/core/stdmsg/src/msgtimedout.cpp @@ -96,5 +96,5 @@ void MessageFailureProcess(TMsgQueue *item, const char* err) Skin_PlaySound("SendError");
ErrorDlgParam param = { err, item };
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGSENDERROR), hwnd, ErrorDlgProc, (LPARAM)¶m);
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_MSGSENDERROR), hwnd, ErrorDlgProc, (LPARAM)¶m);
}
diff --git a/src/core/stdmsg/src/srmm.cpp b/src/core/stdmsg/src/srmm.cpp index 1c4dd443e0..6d283102d6 100644 --- a/src/core/stdmsg/src/srmm.cpp +++ b/src/core/stdmsg/src/srmm.cpp @@ -24,8 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int LoadSendRecvMessageModule(void);
void SplitmsgShutdown(void);
+CMPlugin g_plugin;
+
CLIST_INTERFACE *pcli;
-HINSTANCE g_hInst;
int hLangpack;
PLUGININFOEX pluginInfo = {
@@ -40,12 +41,6 @@ PLUGININFOEX pluginInfo = { { 0x657fe89b, 0xd121, 0x40c2, { 0x8a, 0xc9, 0xb9, 0xfa, 0x57, 0x55, 0xb3, 0x0D } } //{657FE89B-D121-40c2-8AC9-B9FA5755B30D}
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- g_hInst = hinstDLL;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index e477a56005..8654d9153d 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -40,9 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h"
-#define __NO_CMPLUGIN_NEEDED
#include <win2k.h>
-
#include <newpluginapi.h>
#include <m_system.h>
#include <m_database.h>
@@ -94,8 +92,6 @@ struct LOGSTREAMDATA : public GCLogStreamDataBase {}; #define GC_TABCHANGE (WM_USER+0x105)
#define GC_SWITCHTAB (WM_USER+0x106)
-extern HINSTANCE g_hInst;
-
/////////////////////////////////////////////////////////////////////////////////////////
struct GlobalLogSettings : public GlobalLogSettingsBase
@@ -110,10 +106,18 @@ struct GlobalLogSettings : public GlobalLogSettingsBase /////////////////////////////////////////////////////////////////////////////////////////
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(SRMMMOD)
+ {}
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern GlobalLogSettings g_Settings;
extern HMENU g_hMenu;
-extern HINSTANCE g_hInst;
extern BOOL SmileyAddInstalled, PopupInstalled;
// main.cpp
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index f185a1de1f..234ff9a657 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -163,7 +163,7 @@ static LRESULT CALLBACK TabSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ///////////////////////////////////////////////////////////////////////////////////////// CTabbedWindow::CTabbedWindow() : - CDlgBase(g_hInst, IDD_CONTAINER), + CDlgBase(g_plugin.getInst(), IDD_CONTAINER), m_tab(this, IDC_TAB) { } @@ -173,7 +173,7 @@ void CTabbedWindow::OnInitDialog() SetWindowLongPtr(m_tab.GetHwnd(), GWLP_USERDATA, LPARAM(this)); mir_subclassWindow(m_tab.GetHwnd(), ::TabSubclassProc); - m_hwndStatus = CreateWindowEx(0, STATUSCLASSNAME, nullptr, WS_CHILD | WS_VISIBLE | SBT_TOOLTIPS | SBARS_SIZEGRIP, 0, 0, 0, 0, m_hwnd, nullptr, g_hInst, nullptr); + m_hwndStatus = CreateWindowEx(0, STATUSCLASSNAME, nullptr, WS_CHILD | WS_VISIBLE | SBT_TOOLTIPS | SBARS_SIZEGRIP, 0, 0, 0, 0, m_hwnd, nullptr, g_plugin.getInst(), nullptr); SendMessage(m_hwndStatus, SB_SETMINHEIGHT, GetSystemMetrics(SM_CYSMICON), 0); SetWindowPosition(); |