Im working on this windows gui program and its a client/server program and Ive greated a readonly edit box that just displays data from the server, but when I used the function
the word wrap doesnt work, instead it goes on forever, and then finally goes to the next line only if the line is long enough, which it has to be very very long. I tried WM_SETTEXT but that would only put the last thing in the array line, so I was wondering if anyone knew something that would would make replacesel to go ot a new line nicely.
to the createwindow for the edit control
ES_MULTILINE | ES_READONLY
I already had it as readonly and mutliline.
This may help you, if you're trying to do what I think you are.
hWnd being the handle to your edit control and lpString being the text you want to send there
void AppendWindowText(HWND hWnd, const char * lpString)
int iLength = GetWindowTextLength(hWnd);
SendMessage(hWnd, EM_SETSEL, iLength, iLength);
SendMessage(hWnd, EM_REPLACESEL, 0, (LPARAM) lpString);
SendMessage(hWnd, WM_VSCROLL, SB_BOTTOM, (LPARAM)NULL);
I use that code in a chat client I'm working on, just call that function when you need to add text to the edit control
Hey hollowlife, thanks for the help, someone actually helped me with that, and its almost exactly like what you have posted. Im new to Win32 programming, so i just wanted to say thanks to all of you for helping me out!