Click to See Complete Forum and Search --> : ImageList Manipulation


ravee_h
July 13th, 1999, 03:57 PM
I am trying to obtain a handle to a bitmap in the imagelist and use that bitmap in the SetMenuItemBitmap method. The following snippet shows this:

IMAGEINFO iInfo;
CBitmap bmp;
iList.GetImageInfo(&iInfo);
bmp.Attach(iInfo.hbmImage);
pPopup->SetMenuItemBitmaps(0, MF_BYPOSITION, &bmp, &bmp);//pPopup is
the popup menu item.

The above code does not work.
However if I create a bitmap resource and use LoadBitmap to load the bitmap
resource and then use SetMenuItemBitmaps, it works. I have tried several
other things as well but I could not get it working. I am stumped! I would appreciate any suggestion.

Mike Harnad
July 13th, 1999, 04:50 PM
Look in the MENU code section on this site. There are some excellent articles on rendering bitmap menus.

HTH,
Mike