Alex VillaciĀs Lasso a_villacis@palosanto.com writes:
You are right. I did a copy&paste from the SerializeIcon code. What do you think about this patch?
Better, but note that there is a twist with GetIconInfo, if the icon is monochrome the color bitmap is 0 and you then need to get the info from hbmMask and divide the height by 2 (you can always count on Microsoft to design clean and intuitive APIs...)
You also need to delete the bitmaps when done. Note also that GetDC(0) is preferable to CreateCompatibleDC, it avoids creating a new DC just to delete it again.