Dynamic System Tray Icons
Posted on 2004-09-30
I have designed an application that runs majorly as an icon in the windows system tray. Currently, this icon contains two small 4x4 "dots" Each of the two 4x4 areas for the dots can either be empty, representing an off state, or filled red, representing an on state. I currently have 4 different .ico files, one for each possible state of the icon (both dots on, dot 1 on and dot 2 off, dot 2 off and dot 1 on, or both dots off). Given different circumstances, the application changes the icon in the system tray to one of these four .ico files, representing one of the four possible states. In a new revision of this application, each 4x4 dot in the icon needs to be able to receive any one of 16 possible states. Rather than simply off (empty) or on (red), each 4x4 dot can be assigned one of 16 shades, ranging from empty (1), to dim red (8), to bright red(16). It is clearly no longer feasable to create a .ico file to correspond to each possible state. In this case, 16(dot 1) * 16 (dot 2)=256 .ico files would be necessary. I need a way of dynamically generating VB icon objects by overlaying existing .ico files/icon objects or setting individual pixels in an icon object to specific colors within the VB code. Also acceptable would be dynamically generating bitmaps as image objects and then transforming them into the necessary icon object type in the code.
I hope my question is clear. I have tried to explain it as coherently as possible.