From 9942bc46a38d3d923a98e9976505e39b4ce07bb5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 29 Mar 2023 18:48:53 +0300 Subject: stupid MS sends notifications via WM_COMMAND... + code cleaning --- src/core/stdmsg/src/msgdialog.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 8982341358..e7ee4cb6e9 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -649,6 +649,11 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (Contact::OnList(m_hContact)) ShowWindow(GetDlgItem(m_hwnd, IDC_ADD), FALSE); break; + + case IDC_SRMM_LOG: + if (HIWORD(wParam) == EN_VSCROLL && m_pLog->AtBottom()) + StopFlash(); + break; } break; @@ -677,17 +682,6 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, TRUE); return TRUE; } - break; - - case EN_VSCROLL: - if (LOWORD(wParam) == IDC_SRMM_LOG && GetWindowLongPtr((HWND)lParam, GWL_STYLE) & WS_VSCROLL) { - SCROLLINFO si = {}; - si.cbSize = sizeof(si); - si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS; - GetScrollInfo((HWND)lParam, SB_VERT, &si); - if ((si.nPos + (int)si.nPage + 5) >= si.nMax) - StopFlash(); - } } break; @@ -1265,13 +1259,9 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DBEVENTINFO &dbei) RemakeLog(); // Flash window *only* for messages, not for custom events - if (isMessage && !isSent) { - if (isActive) { - if (m_pLog->AtBottom()) - StartFlash(); - } - else StartFlash(); - } + if (isMessage && !isSent) + if (!isActive || !m_pLog->AtBottom()) + StartFlash(); } } -- cgit v1.2.3