CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Posts
    3

    ImageList Manipulation

    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.




  2. #2
    Join Date
    Apr 1999
    Posts
    3,585

    Re: ImageList Manipulation

    Look in the MENU code section on this site. There are some excellent articles on rendering bitmap menus.

    HTH,
    Mike

    Gort...Klaatu, Barada Nikto!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured