summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/chat_window.cpp5
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp1
-rw-r--r--src/mir_app/src/mir_app.def2
-rw-r--r--src/mir_app/src/mir_app64.def2
-rw-r--r--src/mir_app/src/srmm_base.cpp38
-rw-r--r--src/mir_app/src/srmm_util.cpp29
6 files changed, 42 insertions, 35 deletions
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp
index bb721319a0..73816dc2ac 100644
--- a/src/core/stdmsg/src/chat_window.cpp
+++ b/src/core/stdmsg/src/chat_window.cpp
@@ -854,6 +854,7 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) :
void CChatRoomDlg::OnInitDialog()
{
+ CSrmmBaseDialog::OnInitDialog();
m_si->pDlg = this;
SetWindowLongPtr(m_hwnd, GWLP_USERDATA, LPARAM(this));
@@ -867,10 +868,6 @@ void CChatRoomDlg::OnInitDialog()
NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPENING);
- mir_subclassWindow(m_btnFilter.GetHwnd(), Srmm_ButtonSubclassProc);
- mir_subclassWindow(m_btnColor.GetHwnd(), Srmm_ButtonSubclassProc);
- mir_subclassWindow(m_btnBkColor.GetHwnd(), Srmm_ButtonSubclassProc);
-
mir_subclassWindow(m_message.GetHwnd(), MessageSubclassProc);
SetWindowLongPtr(m_log.GetHwnd(), GWLP_USERDATA, LPARAM(this));
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index d28b08d79d..ec6b384b59 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -400,6 +400,7 @@ CSrmmWindow::CSrmmWindow(MCONTACT hContact, bool noActivate, const char *szIniti
void CSrmmWindow::OnInitDialog()
{
+ CSrmmBaseDialog::OnInitDialog();
SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LPARAM)this);
m_bIsMeta = db_mc_isMeta(m_hContact) != 0;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index fb6970252c..327dab2f19 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -419,7 +419,7 @@ Chat_UpdateOptions @418 NONAME
?UpdateOptions@CSrmmBaseDialog@@UAEXXZ @420 NONAME
?ShowColorChooser@CSrmmBaseDialog@@QAEXH@Z @421 NONAME
?ShowFilterMenu@CSrmmBaseDialog@@UAEXXZ @422 NONAME
-_Srmm_ButtonSubclassProc@16 @423 NONAME
+?OnInitDialog@CSrmmBaseDialog@@MAEXXZ @423 NONAME
?StreamInEvents@CSrmmBaseDialog@@UAEXPAULOGINFO@@_N@Z @424 NONAME
?AddLog@CSrmmBaseDialog@@UAEXXZ @425 NONAME
?RedrawLog2@CSrmmBaseDialog@@QAEXXZ @426 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 7f8659dd96..9a6bf47022 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -419,7 +419,7 @@ Chat_UpdateOptions @418 NONAME
?UpdateOptions@CSrmmBaseDialog@@UEAAXXZ @420 NONAME
?ShowColorChooser@CSrmmBaseDialog@@QEAAXH@Z @421 NONAME
?ShowFilterMenu@CSrmmBaseDialog@@UEAAXXZ @422 NONAME
-Srmm_ButtonSubclassProc @423 NONAME
+?OnInitDialog@CSrmmBaseDialog@@MEAAXXZ @423 NONAME
?StreamInEvents@CSrmmBaseDialog@@UEAAXPEAULOGINFO@@_N@Z @424 NONAME
?AddLog@CSrmmBaseDialog@@UEAAXXZ @425 NONAME
?RedrawLog2@CSrmmBaseDialog@@QEAAXXZ @426 NONAME
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index d95ed32a65..9410e76142 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -79,6 +79,44 @@ CSrmmBaseDialog& CSrmmBaseDialog::operator=(const CSrmmBaseDialog&)
return *this;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static LRESULT CALLBACK Srmm_ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg) {
+ case WM_RBUTTONUP:
+ if (db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) != 0) {
+ CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
+ if (pDlg == nullptr)
+ break;
+
+ switch (GetDlgCtrlID(hwnd)) {
+ case IDC_SRMM_FILTER:
+ pDlg->ShowFilterMenu();
+ break;
+
+ case IDC_SRMM_COLOR:
+ pDlg->ShowColorChooser(IDC_SRMM_COLOR);
+ break;
+
+ case IDC_SRMM_BKGCOLOR:
+ pDlg->ShowColorChooser(IDC_SRMM_BKGCOLOR);
+ break;
+ }
+ }
+ break;
+ }
+
+ return mir_callNextSubclass(hwnd, Srmm_ButtonSubclassProc, msg, wParam, lParam);
+}
+
+void CSrmmBaseDialog::OnInitDialog()
+{
+ mir_subclassWindow(m_btnFilter.GetHwnd(), Srmm_ButtonSubclassProc);
+ mir_subclassWindow(m_btnColor.GetHwnd(), Srmm_ButtonSubclassProc);
+ mir_subclassWindow(m_btnBkColor.GetHwnd(), Srmm_ButtonSubclassProc);
+}
+
INT_PTR CSrmmBaseDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
diff --git a/src/mir_app/src/srmm_util.cpp b/src/mir_app/src/srmm_util.cpp
index d1b8be54cd..78ed59e436 100644
--- a/src/mir_app/src/srmm_util.cpp
+++ b/src/mir_app/src/srmm_util.cpp
@@ -72,32 +72,3 @@ MIR_APP_DLL(DWORD) CALLBACK Srmm_MessageStreamCallback(DWORD_PTR dwCookie, LPBYT
}
return 0;
}
-
-EXTERN_C MIR_APP_DLL(LRESULT) CALLBACK Srmm_ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_RBUTTONUP:
- if (db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) != 0) {
- CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
- if (pDlg == nullptr)
- break;
-
- switch (GetDlgCtrlID(hwnd)) {
- case IDC_SRMM_FILTER:
- pDlg->ShowFilterMenu();
- break;
-
- case IDC_SRMM_COLOR:
- pDlg->ShowColorChooser(IDC_SRMM_COLOR);
- break;
-
- case IDC_SRMM_BKGCOLOR:
- pDlg->ShowColorChooser(IDC_SRMM_BKGCOLOR);
- break;
- }
- }
- break;
- }
-
- return mir_callNextSubclass(hwnd, Srmm_ButtonSubclassProc, msg, wParam, lParam);
-}