void CMenuView::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO:
//動(dòng)態(tài)創(chuàng)建彈出菜單
CMenu menu;
menu.CreatePopupMenu(); //創(chuàng)建一個(gè)彈出菜單
menu.AppendMenuW(MF_BYCOMMAND | MF_STRING, ID_RIGHT_CLEAR, _T("剪切(&X)")); //添加子菜單項(xiàng)
menu.AppendMenuW(MF_BYCOMMAND | MF_STRING, ID_RIGHT_COPY, _T("復(fù)制(&C)"));
menu.AppendMenuW(MF_BYCOMMAND | MF_STRING, ID_RIGHT_PASTE, _T("粘貼(&P)"));
menu.AppendMenuW(MF_SEPARATOR);
menu.AppendMenuW(MF_BYCOMMAND | MF_STRING, ID_RIGHT_CLEAR, _T("清除\tCtrl + C"));
ClientToScreen(&point); //將客戶區(qū)的坐標(biāo)轉(zhuǎn)化為屏幕的坐標(biāo)
menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTALIGN, point.x, point.y, this); //加載彈出菜單
CView::OnRButtonDown(nFlags, point);
}


