X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwchat.c;h=64cc16a2b5d1c1b36948343ca68eefe17e91873c;hb=b0c4bb81c045add757b010dc8319da38bad1d510;hp=3b90b2c3d8000dd838820a061baa466a800cf7f0;hpb=b42a7598bf84b00ff82160234839d7b1c9f3f329;p=xboard.git diff --git a/winboard/wchat.c b/winboard/wchat.c index 3b90b2c..64cc16a 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; @@ -207,6 +207,7 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam SendMessage( GetDlgItem(hDlg, IDC_ChatPartner), // [HGM] clickbox: initialize with requested handle WM_SETTEXT, 0, (LPARAM) chatPartner[partner] ); filterHasFocus[partner] = TRUE; + onTop = partner; // a newly opened box becomes top one if(chatPartner[partner][0]) { filterHasFocus[partner] = FALSE; SetFocus( GetDlgItem(hDlg, OPT_ChatInput) ); @@ -285,8 +286,10 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam SetDlgItemText(hDlg, OPT_ChatInput, ""); // from here on it could be back-end SaveInHistory(mess); - if(!strcmp("WHISPER", chatPartner[partner])) + if(!strcmp("whispers", chatPartner[partner])) sprintf(buf, "whisper %s\n", mess); // WHISPER box uses "whisper" to send + else if(!strcmp("shouts", chatPartner[partner])) + sprintf(buf, "shout %s\n", mess); // SHOUT box uses "shout" to send else { if(!atoi(chatPartner[partner])) { sprintf(buf, "> %s\r\n", mess); // echo only tells to handle, not channel @@ -369,7 +372,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);