It follows the ScrollWindow() function
I don't get the expected result, the EDIT control's content, especially when I scroll very quickly, remains painted like a trace behind and I wonder if there's a good method that everyone uses to repaint the window after re-sizing or scrolling it. My function ahead also makes the window flash continuously as I am re-sizing it by dragging its borders.
The window doesn't flash anymore when is being re-sized but the scrolling problems persists. When I scroll upward it seems like the part of the content that should be hidden away is not. It is moved out of the scrolling area and painted above other content of the window. When I re-size it a little bit, everything is re-painted well. So, when I use this function inside WM_SIZE it works. When I use it with WM_VSCROLL it does not.
The window (an EDIT control) I want to scroll is contained by a STATIC control, owned by the window. The EDIT control is sub-classed, and the WM_VSCROLL is handled inside its own procedure. The EDIT control contains other STATIC controls with text and images. Maybe this will give clues, too.