Sign in to follow this  

[.net] Updating an animation with a windows scroll bar

This topic is 3339 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

I have an app that renders a Direct X viewport in one dialog, and has a seperate dialog with an MFC scrollbar in it. When I drag this scrollbar, I want it to scrub the animation in the rendering window. However, when I'm dragging this bar, no other window besides the one containing the scrollbar are updated, and the animation won't update until I release it. Is there an easy way to change this behavior? Thanks! -John

Share this post


Link to post
Share on other sites
Sounds like you're listening to the wrong event.

You need to act on WM_VSCROLL/WM_HSCROLL with SB_THUMBTRACK. This will be sent during dragging the scrollbar.

If you already do that; how do you update the Direct view? Try calling UpdateWindow after InvalidateRect.

Share this post


Link to post
Share on other sites
Those are the ones I'm processing (with the OnHScroll function).

As for updating the Direct View, that's probably the problem. I'm using an engine that wants to own the main game loop, which is at odds with MFC which also wants to own the main loop. So I just call the engine loop from my derived CWinApp::InitInstance. So far I havent had any problems like that, but I'm guessing this might be one....

Anyway to use MFC without it having control of the main loop?

Share this post


Link to post
Share on other sites
Sign in to follow this