views:

19

answers:

1

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: 
  1. Load a few icons.
  2. Start up a timer to get called every so often.
  3. Send STM_SETICON message to the picture control (which is in fact static control).
  4. Kill the timer when no longer needed.
  5. Release the icons handles.

Other points of interest:

  1. if load other types of image objects (as opposed to icons) you need to send respective messages. See STM_SETICON in msdn for details.

  2. 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