VC右键弹出菜单的实现

void CFloatWnd::OnRButtonUp(UINT nFlags, CPoint point) 

{

// TODO: Add your message handler code here and/or call default

CMenu m_Right;

m_Right.LoadMenu(IDR_MENU1);

CMenu *pSub = m_Right.GetSubMenu(0);

ClientToScreen(&point);

pSub->TrackPopupMenu(TPM_LEFTALIGN,point.x,point.y,this,NULL);



CDialog::OnRButtonUp(nFlags, point);

}





其中,IDR_MENU1是一个普通的菜单。



你可能感兴趣的:(VC)