Re: How can I can the WM_VSCROLL event?
- From: daveC <davechow@xxxxxxxxxxx>
- Date: Wed, 9 Jul 2008 20:21:02 -0700 (PDT)
The program has the basic MainFrm, Doc and View files generated by the
Class Wizard. I used it to
collect log messages through the Ethernet port. The log messages could
come from different connections
so it would be more readable if the text are in different colors.
When the data comes in, MainFrm appends it to the Doc by doing
CLogMonitorDoc* pDoc = (CLogMonitor*)GetActiveDocument();
pDoc->logMsg += msg;
pDoc->UpdateAllViews(NULL);
When I append the message, I know which connection it is from. I use
an array to store the connection
number of each line (a line cannot contain message from multiple
connections). When the OnUpdate of
the View class runs, it does:
m_rich.SetWindowText(pDoc->logMsg); where m_rich is a
CRichEditCtrl
I then set each line on the screen to different color using the
connection array.
When new data comes in I would do SetWindowText(...) again. This will
restore all text to black.
As I only set the color to the visible part of the screen, the data
that got scrolled off the screen would remain in black.
I would like to capture the VSCROLL event so that I could update the
visible part of the screen with the
correct color.
I am not sure if I was able to explain what I wanted to do. I hope I
did.
Thanks for your help
David
On Jul 9, 6:54 pm, "Mark Salsbery [MVP]"
<MarkSalsbery[MVP]@newsgroup.nospam> wrote:
"daveC" <davec...@xxxxxxxxxxx> wrote in message
news:2709909d-aad4-4cde-82c9-0177c61977bb@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am new to MFC.
I used the wizard to create an application having DOC and VIEW. I
modified it to use CRichEditCtrl because I need to change the color of
the text. It worked. However, when new text were added which caused
the screen to scroll, the text got scrolled off the screen has lost
the color that I put in. The part of text that got pushed off the
screen became black again when I manually scroll it down. I need to
refresh the screen when I get the WM_VSCROLL message. But I didn't
seem to get it. I tried to capture the message in MainFrm and View
but didn't seem to get it. I used SPY++ and saw the messages. Where
did the message go? Do I need to enable something in order to be able
to capture the messages? I tried to capture a couple like
WM_RBUTTONUP etc and didn't get any one of them.
How did you try handling these messages?
How did you change the color of the text in the control? The text shouldn't
lose its formatting when it's scrolled.
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
Help appreciated.
Thanks- Hide quoted text -
- Show quoted text -
.
- Follow-Ups:
- Re: How can I can the WM_VSCROLL event?
- From: Joseph M . Newcomer
- Re: How can I can the WM_VSCROLL event?
- References:
- How can I can the WM_VSCROLL event?
- From: daveC
- Re: How can I can the WM_VSCROLL event?
- From: Mark Salsbery [MVP]
- How can I can the WM_VSCROLL event?
- Prev by Date: Re: NINTENDO game Development || devkitpro ARM9 || VC++ || NO$GBA
- Next by Date: Re: SaveBarState Fails when it is called from a thread
- Previous by thread: Re: How can I can the WM_VSCROLL event?
- Next by thread: Re: How can I can the WM_VSCROLL event?
- Index(es):
Relevant Pages
|