My ideal approach to this would be to write something from scratch similar
to the output window in Visual Studio.
Each new line would append to the end and probably scroll up. After X number
of lines were added, the oldest would start "dropping off". With some extra
work, you could allow the user to select text directly from the control.
I realize that's a bit of work. Perhaps there is already something like this
on the Web.
It's not clear to me if you are concerned about the speed, or the
An edit control isn't ideal for logging. I've written a few custom
controls for this purpose. But I'm not sure they're that much faster.
if you're updating the display, then I don't know what your concerns
be about flickering.
It is common to write to a bitmap first and then bitblt the bitmap to the
screen. Although this is slower than just drawing to the window, there is
less flicker and it appears "smoother". But it's not really clear to me
much information it is you're showing or how often the display needs to
The updates could come at ~100 mSec. The problem a I have with the Edit
control is that I can't get it to quit scrolling to the beginning whenever
write new text using SetWindowText. There could be hundreds of lines of
text, and I want the user to be able to scoll to the screenful of text
want to watch and have the screen stay in that position, with no scrolling
when new data is written. The main functionality I want, other than just
displaying text, is the ability to copy the text, at least after logging
stopped. So I've been using the bitblt to get the text on the screen, and
when logging stops I display the edit control (write only) so the user can
copy the data to the clipboard.
Until now, this has been all fine and good. Now the problem I have with
edit control in this implementation is getting it to appear in place of
bitblt'ed text seamlessly. It works okay when I just use one font and
change, but I've added the functionality to allow the user to select the
font, and that's when Pandora's box opened up. I got the vertical
straight, because of what you guys pointed out, but the horizontal
still has me baffled. Sometimes, depending on the font, the text is
to the right by a few pixels after the font is changed, and it seems that
is not by a constant amount each time you select even the same font, and
seems not to correspond to any of the entries in TEXTMETRIC.
So I'm currently looking for a better solution. I'll try Joseph M.
Newcomer's suggested download, and if you have any ideas let me know.