[ANNOUNCEMENT] Server Test 88

Lev Bishop lev.bishop@yale.edu
Sun Jun 1 13:42:00 GMT 2003

Hi Earle,

> As for the scaling, check out the bottom of winmultiwindowwindow.c.  
> Feel free to put in a nice 2d filter, but it'll really only make a
> difference for xcalc.  X apps normally only have one icon size
> specified, and that size can be almost anything.  Some of the QT(KDE?)
> apps have an additional extension where they specify multiple icons per
> app, but I have no idea how to get Windoze to grok a multi-sized
> on-the-fly created icon.  It was a real pain getting it to take a
> single-sized on-the-fly one!

I think I can tell you what you need to do to allow small and large icons 
specified seperately. First, you need your window to be WNDCLASSEX not 
WNDCLASS. This gives you the hIcon element as before, which is to be of 
"system large" size, and in addition gives you an element hIconSm, which 
is of "system small" size. Now of course you need to know what system 
large, system small sizes are (the current code seems to assume system 
large is 32x32). You can get this using GetSystemMetrics with parameters 
SM_CXICON, SMCYICON for the system large and SM_CXSMICON, SMCYSMICON for 
system small. The system large size is determined by the video driver and 
cannot be changed any other way, the system small size is controlled by 
the "caption buttons" size setting in the "display properties" applet, 
appearance tab.

How to choose between the different icons available once you know the size 
you want? This is how windows does it:

The image closest in size to the requested size is chosen. 
If two or more images of that size are present, the one that matches the 
color depth of the display is chosen. 
If none exactly match the color depth of the display, Windows chooses the 
image with the greatest color depth without exceeding the color depth of 
the display. 
If all the size-matched images exceed the color depth of the display, the 
one with the lowest color depth is chosen. 
Windows treats all color depths of 8 or more bpp as equal. For example, it 
is pointless to have a 16x16 256 color image and a 16x16 16bpp image in 
the same resourceWindows will simply choose the first one it encounters. 
When the display is in 8bpp mode, Windows will prefer a 16 color icon over 
a 256 color icon, and will display all icons using the system default 


More information about the Cygwin-xfree mailing list