Author | Message | Time |
---|---|---|
Spilled[DW] | [code] case WM_KEYDOWN: if ((int) wParam == 13) { int windowLength = GetWindowTextLength(SendBar); char wt[windowLength + 1]; GetWindowText(SendBar, wt, sizeof(wt)); int wtl2 = GetWindowTextLength(TextBox); char wt2[wtl2 + 1]; GetWindowText(TextBox, wt2, sizeof(wt2)); int len; char wt3[windowLength + wtl2]; wt[windowLength] = '\n'; CopyMemory(wt3, wt2, wtl2); //wt3[2] = '\n'; for(int i=0;i<windowLength + 1;i++) wt3[i + wtl2] = wt[i]; SetWindowText(TextBox, wt3); //SendMessage(hwnd, WM_KEYDOWN, WPARAM(13), LPARAM(0)); SetWindowText(SendBar, NULL); } [/code] Ok, sloppy coding i know but im new to c++ no flaming plz. What im trying to do is take the text from a SendBar and add it to the chat text box and have add the text from the sendbar on a new line. i can get it to add it to the chat but not on a new line so all help is appreciated. (WM_KEYDOWN SubClassed) Thanks in advance. | June 16, 2005, 8:33 PM |