From 9a4428ce1a6e76ed25e3e30d85cf119e7b437891 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 9 Nov 2024 18:48:38 +0300 Subject: code cleaning --- plugins/TabSRMM/src/msgdialog.cpp | 4 +--- plugins/TabSRMM/src/msgdlgother.cpp | 10 +++------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 476d42eb5f..3d93d6d4a5 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -923,10 +923,8 @@ void CMsgDialog::onClick_Filter(CCtrlButton *pButton) if (m_bFilterEnabled && !g_chatApi.bRightClickFilter) ShowFilterMenu(); else { - if (m_hwndFilter) { + if (m_hwndFilter) SendMessage(m_hwndFilter, WM_CLOSE, 0, 0); - m_hwndFilter = nullptr; - } RedrawLog(); UpdateTitle(); diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index c2f2afd3e3..b7696c9658 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -1768,11 +1768,9 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP Chat_SetFilters(pDlg->getChat()); pDlg->RedrawLog(); } - DestroyWindow(hwndDlg); - break; - case WM_DESTROY: - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0); + pDlg->m_hwndFilter = nullptr; + DestroyWindow(hwndDlg); break; } return FALSE; @@ -2551,10 +2549,8 @@ void CMsgDialog::UpdateWindowState(UINT msg) RECT rcFilter; GetWindowRect(m_hwndFilter, &rcFilter); - if (!PtInRect(&rcFilter, pt)) { + if (!PtInRect(&rcFilter, pt)) SendMessage(m_hwndFilter, WM_CLOSE, 1, 1); - m_hwndFilter = nullptr; - } } if (m_bIsAutosizingInput && m_iInputAreaHeight == -1) { -- cgit v1.2.3