Subj : Re: WM_PAINT or TWindow::Paint To : borland.public.cpp.borlandcpp From : maeder Date : Tue Aug 09 2005 08:33 pm "MarvinAvery" writes: > I am using BC5.02 and OWLNext. > > I have a window in which I am displaying lines of text with a > fixed-pitch font. > This window can be scrolled horizontally. To do this, I call: > > ScrollWindowEx (dx, 0, &rect, &rect, 0, 0, SW_INVALIDATE|SW_ERASE); > UpdateWindow(); > > UpdateWindow() causes a WM_PAINT message to be generated. More specifically, it causes it to be sent (rather than posted). > In my TMyWindow::Paint() routine, I pant a line as follows: [SCNR] That must look interesting. Do you also paint it? :-)] > dc.TextOut (x_pos, y_pos, line_of_text); > > Now, if I scroll 1 column to the left (dx = width of 1 character in > screen units), Windows physically scrolls my window one column left > and, because I use UpdateWindow(), Windows "marks" only the > right-most column for painting. The Windows term for this is "invalidating". IIRC, ScrollWindowEx() invalidates just the rectangle that moves on screen because of the scrolling. > Thus, when calling dc.TextOut() even though I am writing the entire > line, only the last character actually gets written (or painted). Which is typically more efficient than writing the whole line. > Now for my question....... > > Is there a way of telling or forcing Windows, for specific lines > only, to actually paint the *entire* line? You should be able to use InvalidateRect() for the rectangles occupied by these lines. BUT: I don't see the point of your question. What's the difference of painting N-1 characters over their own graphical representation? .