Archived

This topic is now archived and is closed to further replies.

Win32 prob, when to update

This topic is 5145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I''ve got another problem with my Win32 application. What I have is a bunch of static texts and editboxes that should be moved with a scrollbar. Fine, I''ve got the scrolling to work after a lot of effort but it''s damn ugly as it is now, I get tearing and a lot of ugly artifacts.. Can someone please describe for me how I should do to avoid these problems? Thanks for any help. -Lord Maz-

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
you should probably put them all inside some kind of no-border window and move the entire window using the scrollbars. This will look a lot better.

Share this post


Link to post
Share on other sites
Some kind of no-boarder window? I don''t understand what you mean :/

What I have is one window for the entire screen, m_hWND, a few for the other windows, then the m_hStatusViewArea window which contains a linked list of static boxes and editboxes. On the right i have a scrollbar that uses ScrollWindowEx to move all the boxes in the list up and down. All redrawing and changing of the window is handled in the Resize() function that is called every time windows gets a WM_SIZE or when you for example are pulling down the scrollbar (SB_THUMBTRACK). Resize uses SetWindowPos() first before scrolling to put the pieces in place.

Anyway, I''ve poked around alot and found a really slow and ugly method that atleast gets rid of the artifacts (sending a WM_SETREDRAW message to all the windows, change em, and then restore and invalidize them) but the flickering while scrolling is still there.. Please help out people, if you know how the rendering of a window works please share the knowledge.

Share this post


Link to post
Share on other sites
The AP is suggesting you have a hierarchy like this:

You main window with the scroll bar
|
A borderless window big enough to enclose all you controls
|
All your controls

So now, when the scroll bar is moved, just update the position of the borderless window and all your controls will move as well.

Skizz

Share this post


Link to post
Share on other sites