summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-03 21:25:47 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-03 21:25:47 +0300
commit40648808bb181f9b5c7c9d3b7537e6a9bd9b75bb (patch)
tree5195fcfc3902c35382c69641e749cd5f8120be5b
parent4300e0650271a2c245aec08782497f4bec57f59c (diff)
StdMsg: better fix for Esc in chats
-rw-r--r--src/core/stdmsg/src/chat_window.cpp11
-rw-r--r--src/core/stdmsg/src/stdafx.h1
2 files changed, 5 insertions, 7 deletions
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;