菜单栏图标设置
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP3);
//GetMenu()->GetSubMenu(0)->CheckMenuItem(0,MF_BYPOSITION|MF_CHECKED);//可以显示
if(!GetMenu()->GetSubMenu(0)->SetMenuItemBitmaps(0,MF_BYPOSITION,&bitmap,&bitmap))
{
int n=GetLastError();
CString msg;
msg.Format("失败:%d",n);
AfxMessageBox(msg);
}
else
{
AfxMessageBox("成功");
}
}
/////成功了,没图没出来