Loading icons of a specific color depth
Posted on 2003-03-20
I'm currently programming an application which shows an icon in the tray. The problem, however, is that any versions of Windows older than ME don't support hi-color icons in the tray, so Windows reduces the color depth of my icon in an ugly fashion (instead of just taking the 4bpp image present in the icon). I'm using LoadImage to load the icon's 16x16 image, however, this function (and LoadIcon neither) does not let me specify the color depth of the icon I want to load.
I've found a temporary solution by defining two icon resources: the original one (which has images of 16x16,32x32,48x48 of 16, 256, and Windows XP alpha-blended colors each) and a copy of the original one containing only the 16-color images, but that's certainly not the best solution.
I'm using Microsoft Visual C++ 6.0 Enterprise on Windows 2000 with the latest Platform SDK
The app must run on Windows 98, Windows NT 4.0 with IE4 + Desktop Update