Solution 1 by Aescleal is a very good explanation.
If you don't want to create a custom control, it may be possible to reduce the flickering. But it can't be totally avoided using a
CEdit
control.
You existing code can be tweaked:
- You may count the used edit size yourself and avoid calling
GetLength()
. - Calling
LineScroll()
is not necessary, because using ReplaceSel()
will scroll here.
You may use a text buffer, append new lines to this buffer and use
SetWindowText()
to pass the complete content to the Edit control. With the small buffer size of 10240, this may result in less flickering.