1
-----增加右键弹出菜单方法一:
Project-->Add to Project-->Components and Controls -->Visual C++ Components
-->Pop-up menu 注意要加到View类中,不要加到Frame类中,因为Frmae被View覆盖,收不到鼠标消息.
2
-----增加右键弹出菜单方法二: 模仿一,在鼠标右键响应函数中加载自己创建的资源menu,用TrackPopupMenu弹出菜单
3 消息响应顺序: 对"显示"添加消息响应函数,在CMenuView和CMainFrame类中都添加
void CMenuView::OnMenuitemShow()
{
// TODO: Add your command handler code here
MessageBox("CMenuView::OnMenuitemShow()");
}
void CMainFrame::OnMenuitemShow()
{
// TODO: Add your command handler code here
MessageBox("CMainFrame::OnMenuitemShow()");
}