Hi, Is there any ways for me to add a check marks or icon into the submenu?
I'm currently creating owner draw menu.
So far, I only able to print out the text into the submenu... I failed to put the check mark/icon into it.. Any help will be appreciated
Currently all my drawing are done at:
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
}
Regards,
KH
Last edited by karhong; December 17th, 2008 at 03:34 AM.
Check out the
ON_UPDATE_COMMAND_UI() macro. This allows you to update menu items dynamically, and enable/disable menu items as well as set the checkflag.
The pCmdUI pointer passed in allows many different menu items to share the same OnUpdateCommand function, or you can use different functions for different menu items.
This OnUpdateCommand() function is called each time the menu is displayed, so it's a handy way to make sure your menu items are updated each time they are needed.
As for the icons, you might want to start using the new MFC classes in VS2008 - these support icons and everything else you need for nice menus. You just create a toolbar icon with the same ID as the menu item, and it picks up the toolbar icon and puts it in the menu bar. I'm using the old BCG classes from before Microsoft bought them, so I haven't used the Microsoft versions yet, but they are essentially the same functionality.
Bookmarks