NtQuery/Scylla — Issue #6: Black icons with 16-bit color depth
Author: pezcode
Created: 2011-10-10 00:09:23+00:00
State: open

Setting the monitor to 16-bit depth makes the treeview icons have a black background instead of alpha transparency.
The status bar icon is not affected.

Simple to fix:
- Determine the display bit depth by calling GetDeviceCaps(BITSPIXEL) on the desktop DC.
- Create 16-bit masked imagelist if the return value <= 16, otherwise create 32-bit imagelist:

if (nColors > 16)
ImageList.Create(16, 16, ILC_COLOR32, 1, 1);
else
ImageList.Create(16, 16, ILC_COLOR24 | ILC_MASK, 1, 1);