From cc96ef0550815295a295fdd6e34c85af2f8f7340 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 21 Mar 2017 18:42:14 +0300 Subject: no need to export Srmm_ButtonSubclassProc anymore --- include/m_chat_int.h | 4 +--- libs/win32/mir_app.lib | Bin 112836 -> 112886 bytes libs/win64/mir_app.lib | Bin 108306 -> 108382 bytes plugins/Scriver/src/chat_window.cpp | 5 +---- plugins/Scriver/src/msgdialog.cpp | 2 ++ plugins/TabSRMM/src/chat_window.cpp | 4 ---- plugins/TabSRMM/src/msgs.cpp | 1 + src/core/stdmsg/src/chat_window.cpp | 5 +---- src/core/stdmsg/src/msgdialog.cpp | 1 + src/mir_app/src/mir_app.def | 2 +- src/mir_app/src/mir_app64.def | 2 +- src/mir_app/src/srmm_base.cpp | 38 ++++++++++++++++++++++++++++++++++++ src/mir_app/src/srmm_util.cpp | 29 --------------------------- 13 files changed, 47 insertions(+), 46 deletions(-) diff --git a/include/m_chat_int.h b/include/m_chat_int.h index 64fe186bb3..ce3324e47e 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -378,9 +378,6 @@ EXTERN_C MIR_APP_DLL(DWORD) CALLBACK Srmm_LogStreamCallback(DWORD_PTR dwCookie, // receives char** as the first parameter EXTERN_C MIR_APP_DLL(DWORD) CALLBACK Srmm_MessageStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb); -// handles rclick on some buttons -EXTERN_C MIR_APP_DLL(LRESULT) CALLBACK Srmm_ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - // updates options for all windows EXTERN_C MIR_APP_DLL(void) Chat_UpdateOptions(); @@ -401,6 +398,7 @@ class MIR_APP_EXPORT CSrmmBaseDialog : public CDlgBase protected: CSrmmBaseDialog(HINSTANCE hInst, int idDialog, SESSION_INFO *si = nullptr); + virtual void OnInitDialog() override; virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override; void DoEventHook(int iType, const USERINFO *pUser, const wchar_t *pszText, INT_PTR dwItem); diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index 29d1f9202b..144ef59b40 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib index 64bcea9325..b03790a0d0 100644 Binary files a/libs/win64/mir_app.lib and b/libs/win64/mir_app.lib differ diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index c8fd483e3c..7d76fc1a76 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -894,6 +894,7 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) void CChatRoomDlg::OnInitDialog() { + CScriverWindow::OnInitDialog(); m_si->pDlg = this; NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPENING); @@ -909,10 +910,6 @@ void CChatRoomDlg::OnInitDialog() mir_subclassWindow(m_message.GetHwnd(), MessageSubclassProc); mir_subclassWindow(m_nickList.GetHwnd(), NicklistSubclassProc); - mir_subclassWindow(m_btnFilter.GetHwnd(), Srmm_ButtonSubclassProc); - mir_subclassWindow(m_btnColor.GetHwnd(), Srmm_ButtonSubclassProc); - mir_subclassWindow(m_btnBkColor.GetHwnd(), Srmm_ButtonSubclassProc); - Srmm_CreateToolbarIcons(m_hwnd, BBBF_ISCHATBUTTON); RECT rc; diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 6c31cdc6ec..2e0f3c5742 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -653,6 +653,8 @@ CSrmmWindow::CSrmmWindow(MCONTACT hContact, bool bIncoming, const char *szInitia void CSrmmWindow::OnInitDialog() { + CScriverWindow::OnInitDialog(); + SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this); WindowList_Add(pci->hWindowList, m_hwnd, m_hContact); diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 68a9e5a15d..e2efde0ab3 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -1597,10 +1597,6 @@ void CChatRoomDlg::OnInitDialog() mir_subclassWindow(m_list.GetHwnd(), NicklistSubclassProc); mir_subclassWindow(m_log.GetHwnd(), LogSubclassProc); - 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); m_message.SendMsg(EM_SUBCLASSED, 0, 0); diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 8583720511..6c902c6570 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -156,6 +156,7 @@ void CTabBaseDlg::LoadSettings() void CTabBaseDlg::OnInitDialog() { + CSrmmBaseDialog::OnInitDialog(); SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this); // m_hwnd is valid, pass it to the tab control 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); -} -- cgit v1.2.3