对话的菜单支持ON_UPDATE_COMMAND_UI
ON_WM_INITMENUPOPUP()
void xxx::OnInitMenuPopup( CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu )
{
CCmdUI CmdUI;
for(UINT Idx = 0; Idx < pPopupMenu->GetMenuItemCount(); Idx++)
{
CmdUI.m_nID = pPopupMenu->GetMenuItemID(Idx);
CmdUI.m_nIndex = Idx;
CmdUI.m_nIndexMax = pPopupMenu->GetMenuItemCount();
CmdUI.m_pMenu = pPopupMenu;
CmdUI.DoUpdate(this, FALSE);
}
}