X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwchat.c;h=81e190d86db807c04f64cb0ec9d4155004772635;hb=dcfab363332520fedcd4e6e8c791a854ba548e83;hp=4a1b4d317ba6cdaa4d6e8acb883e7e51c70fb599;hpb=74c6f0bfb6476b2ba21f90d9e5d34130b26825ef;p=xboard.git diff --git a/winboard/wchat.c b/winboard/wchat.c index 4a1b4d3..81e190d 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -61,7 +61,7 @@ char *NextInHistory(); extern HWND ChatDialog; extern HINSTANCE hInst; -extern HWND hwndMain; +extern HWND hwndConsole; extern WindowPlacement wpChat[MAX_CHAT]; extern WindowPlacement wpConsole; @@ -262,12 +262,9 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam switch (LOWORD(wParam)) { - case IDCANCEL: - chatHandle[partner] = 0; - chatPartner[partner][0] = 0; - ChatPopDown(); - EndDialog(hDlg, TRUE); - break; + case IDCANCEL: /* let Esc key switch focus back to console */ + SetFocus(GetDlgItem(hwndConsole, OPT_ConsoleInput)); + break; case IDC_Clear: SendMessage( GetDlgItem(hDlg, IDC_ChatMemo), WM_SETTEXT, 0, (LPARAM) "" ); @@ -372,7 +369,7 @@ void ChatPopUp(char *icsHandle) lpProc = MakeProcInstance( (FARPROC) ChatProc, hInst ); /* Note to self: dialog must have the WS_VISIBLE style set, otherwise it's not shown! */ - CreateDialog( hInst, MAKEINTRESOURCE(DLG_Chat), hwndMain, (DLGPROC)lpProc ); + CreateDialog( hInst, MAKEINTRESOURCE(DLG_Chat), hwndConsole, (DLGPROC)lpProc ); FreeProcInstance(lpProc);