summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-09-04 19:41:41 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-09-04 19:41:41 +0300
commit84fdd0b18e45ea5d9fc84550387479b02bf2bfc1 (patch)
tree4d595b210c5aee04ef3ce0112aa7f54ddb31379a /src/core
parente80684d7a2ad3afff40ec1c211fba92bb457ea4f (diff)
fixes #2044 (strange Select all behaviour in StdMsg private chats)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp22
1 files changed, 16 insertions, 6 deletions
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;
}