Prevent <Esc> closing chat box
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 26 Mar 2010 17:17:44 +0000 (18:17 +0100)
committerArun Persaud <arun@nubati.net>
Sat, 27 Mar 2010 18:37:00 +0000 (11:37 -0700)
Let it in stead switch focus back to the console window.

winboard/wchat.c

index 64cc16a..81e190d 100644 (file)
@@ -262,12 +262,9 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
 \r
         switch (LOWORD(wParam)) {\r
 \r
-       case IDCANCEL:\r
-           chatHandle[partner] = 0;\r
-           chatPartner[partner][0] = 0;\r
-            ChatPopDown();\r
-           EndDialog(hDlg, TRUE);\r
-            break;\r
+       case IDCANCEL: /* let Esc key switch focus back to console */\r
+           SetFocus(GetDlgItem(hwndConsole, OPT_ConsoleInput));\r
+           break;\r
 \r
        case IDC_Clear:\r
            SendMessage( GetDlgItem(hDlg, IDC_ChatMemo), WM_SETTEXT, 0, (LPARAM) "" );\r