1、完成对一个Menu Item 的标识:CheckMenuItem()
// CMainFrame::OnToggleTestMenuItem() is a menu command handler for
// "Test" menu item (whose resource id is ID_HELP_TEST). It toggles
// the checked or unchecked state of the "Test" menu item.
// CMainFrame is a CFrameWnd-derived class.
void CMainFrame::OnToggleTestMenuItem()
{
// Get the popup menu which contains the "Test" menu item.
CMenu* mmenu = GetMenu();
CMenu* submenu = mmenu->GetSubMenu(3);
// Check the state of the "Test" menu item. Check the menu item
// if it is currently unchecked. Otherwise, uncheck the menu item
// if it is not currently checked.
UINT state = submenu->GetMenuState(ID_HELP_TEST, MF_BYCOMMAND);
ASSERT(state != 0xFFFFFFFF);
if (state & MF_CHECKED)
submenu->CheckMenuItem(ID_HELP_TEST, MF_UNCHECKED | MF_BYCOM