Save icons with 256 colors

Hello

I want to improve my freeware icon and glyph viewer Picto with some
neccessary features. One of them is to save icons with 256 colors.
Can someone tell my how to save an ICO without losing colors.

Pleas mail me.
Greetings

Stefan

stefa...@mail.dma.be
http://bewoner.dma.be/stefancr