1个回答
展开全部
try this code:
BOOL CMainFrame::OnShowPopupMenu(CMFCPopupMenu* pMenuPopup)
{
if(pMenuPopup)
{
int iIndex = -1;
CMFCPopupMenuBar* pMenuBar = pMenuPopup->GetMenuBar();
if (!CMFCToolBar::IsCustomizeMode()&& (NULL != pMenuBar) && (iIndex=pMenuBar->CommandToIndex(ID_EDIT_PASTE))>=0)
{
pMenuPopup->InsertSeparator(iIndex+1);
pMenuPopup->InsertItem(CMFCToolBarMenuButton(IDS_EDIT_MYITEM_1,NULL,-1,_T("&MyItem 1")),iIndex+2);
pMenuPopup->InsertItem(CMFCToolBarMenuButton(IDS_EDIT_MYITEM_1 + 1,NULL,-1,_T("&MyItem 2")),iIndex+3);
}
}
return TRUE;
}
BOOL CMainFrame::OnShowPopupMenu(CMFCPopupMenu* pMenuPopup)
{
if(pMenuPopup)
{
int iIndex = -1;
CMFCPopupMenuBar* pMenuBar = pMenuPopup->GetMenuBar();
if (!CMFCToolBar::IsCustomizeMode()&& (NULL != pMenuBar) && (iIndex=pMenuBar->CommandToIndex(ID_EDIT_PASTE))>=0)
{
pMenuPopup->InsertSeparator(iIndex+1);
pMenuPopup->InsertItem(CMFCToolBarMenuButton(IDS_EDIT_MYITEM_1,NULL,-1,_T("&MyItem 1")),iIndex+2);
pMenuPopup->InsertItem(CMFCToolBarMenuButton(IDS_EDIT_MYITEM_1 + 1,NULL,-1,_T("&MyItem 2")),iIndex+3);
}
}
return TRUE;
}
追问
没有找到这个函数啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询