What do i need to change icons at runtime every 5 seconds in picture control to give the user a notification that the work is in progress?
A:
- Load a few icons.
- Start up a timer to get called every so often.
- Send STM_SETICON message to the picture control (which is in fact static control).
- Kill the timer when no longer needed.
- Release the icons handles.
Other points of interest:
if load other types of image objects (as opposed to icons) you need to send respective messages. See STM_SETICON in msdn for details.
The timer is an interrupt, in difference for any other windows message, hence might be thread unsafe if you are not careful. Leave the timer subroutine as soon as possible.
Hope this helps. Miro
Miroslav Bonchev
2010-07-14 21:00:57