Are HBITMAPs assigned via SetMenuItemInfo automatically deleted on DestroyMenu()?

Viewed 84

Using CreatePopupMenu() to create HMENU, adding text items to it via AppendMenu(), then loading an icon, using GetIconInfo() to get the bitmap, assigning that bitmap to the HMENU via SetMenuItemInfo(). Now I presume I need to keep that HBITMAP from GetIconInfo() valid so I can't delete it at this time.

The question is does DestroyMenu() delete the HBITMAP assigned to it, or do I need to loop through the menu and DeleteObject() for each item that has an assigned HBITMAP? If I do have to do that, do I have to remove it via setting HBITMAP in the HMENU to NULL prior to DeleteObject() or the fact that after the loop I'll be calling DestroyMenu() enough?

TIA!!

0 Answers
Related