|
发表于 2020-1-5 11:15:01
|
显示全部楼层
void CMainFrame::OnInitMenu(CMenu* pMenu)
{
CFrameWnd::OnInitMenu(pMenu);
CMenu *pSubMenu;
UINT nCount,nSubCount,nID;
nCount=pMenu->GetMenuItemCount();//子菜单的列数
for(UINT i=0;i<nCount;i++)
{
pSubMenu =pMenu->GetSubMenu(i);
nSubCount=pSubMenu->GetMenuItemCount();//此列菜单菜单项的个数
for(UINT j=0;j<nSubCount;j++)
{
nID=pSubMenu->GetMenuItemID(j);
//将框架菜单所有菜单都添加MF_OWNERDRAW标志
pSubMenu->ModifyMenu(j,MF_BYPOSITION|MF_OWNERDRAW,nID);
}
}
}
|
|