An application i'm currently working on is a 'system-tray' app. That is, it doesn't show a main window, only the tray icon and dialogs when the user chooses certain menu options on the icon.
The Problem:
I would like to be able to dynamically create an icon for the system tray based on certain states of the application. these states may be something like the number of loaded modules, and so creating a static icon resource for each state is not necessarily a viable option. I have the following code that will load a base bitmap resource and create an icon from it:
In that function, or another, I can select the loaded bitmap into the device context and draw onto it there... that's fine. My problem is that I would like to be able to use alpha channels in drawing in the bitmap. I have tried selecting the loaded bitmap into the device context and using AlphaBlend(), and TransparentBlt(), but once i show the icon in the system tray, it just shows up as a solid icon... no alpha. I have searched google and looked through many MSDN pages, but still haven't had any luck figuring out how to do this solely from a device context. Any help would be greatly appreciated!