From 84fdd0b18e45ea5d9fc84550387479b02bf2bfc1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 4 Sep 2019 19:41:41 +0300 Subject: fixes #2044 (strange Select all behaviour in StdMsg private chats) --- src/core/stdmsg/src/msgdialog.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 0bea99d46a..92a66934e7 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -997,6 +997,8 @@ LRESULT CMsgDialog::WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam) POINT pt; GetCursorPos(&pt); + SetFocus(m_log.GetHwnd()); + HMENU hMenu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_CONTEXT)); HMENU hSubMenu = GetSubMenu(hMenu, 0); TranslateMenu(hSubMenu); @@ -1030,19 +1032,27 @@ LRESULT CMsgDialog::WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_LBUTTONUP: - m_log.SendMsg(EM_EXGETSEL, 0, (LPARAM)&sel); - if (sel.cpMin != sel.cpMax) { - m_log.SendMsg(WM_COPY, 0, 0); - sel.cpMin = sel.cpMax; - m_log.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel); + if (isChat()) { + m_log.SendMsg(EM_EXGETSEL, 0, (LPARAM)& sel); + if (sel.cpMin != sel.cpMax) { + m_log.SendMsg(WM_COPY, 0, 0); + sel.cpMin = sel.cpMax; + m_log.SendMsg(EM_EXSETSEL, 0, (LPARAM)& sel); + } + SetFocus(m_message.GetHwnd()); } - SetFocus(m_message.GetHwnd()); break; case WM_KEYDOWN: bool isShift = (GetKeyState(VK_SHIFT) & 0x8000) != 0; bool isCtrl = (GetKeyState(VK_CONTROL) & 0x8000) != 0; bool isAlt = (GetKeyState(VK_MENU) & 0x8000) != 0; + + if (wParam == 0x57 && isCtrl && !isAlt) { // ctrl-w (close window) + CloseTab(); + return TRUE; + } + if (ProcessHotkeys(wParam, isShift, isCtrl, isAlt)) return FALSE; } -- cgit v1.2.3