Bitmap to Icon

Hello all

I'm trying to create an Icon from a given bitmap. A bitmap which has a
defined transparent color. After looking in the VCL controls I haven't found
anything so I tried in the WinAPI and found the function
"CreateIconIndirect" which creates an Icon from two bitmaps, one is the
masked bitmap and the other is the bitmap itself.

My problem here is if there isn't any other way to do it how can I create
the masked bitmap??? The API references sais that the mask bitmap is aplied
to the destination dc with an SrcAnd copymode and then the bitmap itself
with SrcInvert. So I cannot found a way of starting with the Bitmap and the
transparent color create the maked bitmap, I have tried a lot of
convinations but I don't got it :(((

Any help

Regards
                    Luis-