MFC中右键弹出菜单

建立一个MENU资源IDR_MENU_XXX,在OnRButtonDown函数下加入以下代码:
    CMenu menu;
    menu.LoadMenu(IDR_MENU_XXX);
    CMenu* pPopup = menu.GetSubMenu(0);
 
    ClientToScreen(&point);
    pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,GetParent());



你可能感兴趣的:(mfc,mfc,menu)