bitmap before ImageList_AddMasked rather then call ImageList_SetImagesCount after.
Attach a file by drag & drop or click to upload