Hi,
The current functionality is not correct either then. It works ok for a normal SS_ICON, but if you use SS_CENTERIMAGE with it, it paints the background around the icon where there should be no background. I will experiment with transparent icons and improve my patch. Thankyou for the info.
I've already created a little test program: Windows draws the background behind the icon, but not the entire client area. It should be easy to modify the existing code.
Your second patch (background for bitmaps in static controls) leaks the handle of the brush if GetPixel succeeds. If GetPixel fails you use the brush returned by SendMessage - but my test program shows that Windows doesn't paint the background at all in this case.
Regards Michael