Blinking item's picture Tree Control
-
Hi I'm doing some finishing touch for my project, mostly improving the GUI. My project is an SDI of Windows Explorer style with a tree view on the left. The items in the tree correspond to e.g computers, some active and some idle. I want to have these active nodes blinking but I don't know how to do it, more specifically how to change the image of an tree item in run time. I have think of one way: Using a timer, delete the node and reinsert it with different image when there is WM_TIMER. This way seems to work but it leads to some problems I don't want. More over, my program must run fast and stable so I don't want to use any kind of activeX, just MFC or Win API. I've just run into VC++ for 1 month (although I have programed C++ on linux for years) so my question may be a little bit silly. please help me thanks
-
Hi I'm doing some finishing touch for my project, mostly improving the GUI. My project is an SDI of Windows Explorer style with a tree view on the left. The items in the tree correspond to e.g computers, some active and some idle. I want to have these active nodes blinking but I don't know how to do it, more specifically how to change the image of an tree item in run time. I have think of one way: Using a timer, delete the node and reinsert it with different image when there is WM_TIMER. This way seems to work but it leads to some problems I don't want. More over, my program must run fast and stable so I don't want to use any kind of activeX, just MFC or Win API. I've just run into VC++ for 1 month (although I have programed C++ on linux for years) so my question may be a little bit silly. please help me thanks
Instead of deleting and readding the item, simply change its icon (you ARE using icons, right?) and redraw the item each time the timer fires, alternating between two or more icons (more icons can be used to animate a particular item). If not using icons, you can use the
TVIS_DROPHILITED
and/orTVIS_BOLD
item states to make the item itself flash. Look-up theTVITEM
structure for more details on those states. Peace!-=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites (Please rate this post!)