summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-03-29 18:48:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-03-29 18:48:53 +0300
commit9942bc46a38d3d923a98e9976505e39b4ce07bb5 (patch)
tree422f570e93731dfc9317c282e09612aafd2eed1a
parent53b30ffaf5c2d584d758c01dbae07bc00d7f814e (diff)
stupid MS sends notifications via WM_COMMAND... + code cleaning
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp26
1 files changed, 8 insertions, 18 deletions
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();
}
}