Click to See Complete Forum and Search --> : How Do I "Scroll" CStatic Objects Constantly on a Dialog?


KEhlar
June 1st, 1999, 08:38 AM
Hi all,

I'm writing a marquee-like desktop tool that I really need some help with. Basically it's a CDialog at the bottom of the monitor screen with a stream of CStatic objects moving from right to left. The user can click on any of the CStatic objects and it will open up another CDialog with more information. The number of CStatic objects is dependent on a file read prior to creating the main CDialog so the CStatic objects are created dynamically. I got it to work to the point where I can read the file (from MSAccess), size the CDialog to the monitor's size, and create all the CStatic objects including event handling. What I need to do now is to get these CStatic objects to move in an infinite loop from right to left! I don't really know where to start so if someone can give me a pointer I'd really appreciate it. I'm thinking that maybe I will need to create a thread that will, in an infinite loop, change the location of every CStatic object so that they appear to be moving from right to left. Is that an incorrect approach? I'm very new to VC++, as a matter of fact I'm using this project partially to learn VC++ well. So far I've found that it's a very useful tool but difficult to learn on my own. My background is in Java.

Thanks ahead of time for any assistance.

Sam Hobbs
June 1st, 1999, 09:23 AM
In OnInitialUpdate do a SetTimer, in DestroyWindow do a KillTimer. Then add a message-handler for the WM_TIMER message.