Re: How can I can the WM_VSCROLL event?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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 -

.



Relevant Pages

  • Re: Spellcheck Scrolling
    ... should be removed after connection issues have been fixed. ... Alternatively open MSConfig (Start, Run ... >>> "scroll" in the check spelling screen. ... then the highlighted word in the spellcheck pop-up will ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress.stationery)
  • Re: What could cause [NSTextView setStringValue] to fail?
    ... connection, and you have to scroll through a long popup menu to choose ... You don't have to scroll. ... specify that an outlet should be an NSTextField, type NSTextF and hit ...
    (comp.sys.mac.programmer.help)
  • Re: Dial-UP Networking issues
    ... scroll down and see if Telephony is checkmarked and if it shows a status of Running. ... Dial-up modem or PPPoE option in New Connection Wizard is unavailable: ... dial-up connection is greyed out and not available. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Ugliest site ever competition ( was Re: Easter)
    ... connection; it's worth it: ... I can reproduce that look here, ... I just have to scroll up the text size from the too-small-but-kewl size the site assumes I'm using. ...
    (alt.html)