From 40648808bb181f9b5c7c9d3b7537e6a9bd9b75bb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 3 Mar 2017 21:25:47 +0300 Subject: StdMsg: better fix for Esc in chats --- src/core/stdmsg/src/chat_window.cpp | 11 +++++------ src/core/stdmsg/src/stdafx.h | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 128daf3b36..d4e544e1ec 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -306,6 +306,11 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return TRUE; } + if (wParam == VK_ESCAPE && !isCtrl && !isAlt) { // Esc (close tab) + SendMessage(hwndDlg, GC_CLOSEWINDOW, 0, 0); + return TRUE; + } + if (wParam == 0x49 && isCtrl && !isAlt) { // ctrl-i (italics) CheckDlgButton(hwndDlg, IDC_ITALICS, IsDlgButtonChecked(hwndDlg, IDC_ITALICS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED); SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_ITALICS, 0), 0); @@ -949,12 +954,6 @@ void CChatRoomDlg::OnInitDialog() NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPEN); } -void CChatRoomDlg::OnClose() -{ - if (g_Settings.bTabsEnable) - SendMessage(GetParent(m_hwndParent), GC_REMOVETAB, 0, (LPARAM)this); -} - void CChatRoomDlg::OnDestroy() { NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING); diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 3e0276e705..f39b6c0199 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -197,7 +197,6 @@ public: CChatRoomDlg(SESSION_INFO*); virtual void OnInitDialog() override; - virtual void OnClose() override; virtual void OnDestroy() override; virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override; -- cgit v1.2.3