PopMenu的实现:
void CTestboxDlg::OnRButtonDown(UINT nFlags, CPoint point)
{
CMenu popMenu,*t;
//根据menu模板加载menu
popMenu.LoadMenu(IDR_POPMENU);
t=popMenu.GetSubMenu(0);
//mouse button down event-We can get the point when mouse click.
//But the point must be convert to Screen coordinate,so ClientToScreen()
//function will be called.这里唯一需要我们注意的就是要就行坐标的转化。
ClientToScreen(&point);
t->TrackPopupMenu(TPM_LEFTBUTTON|TPM_RIGHTBUTTON,point.x,point.y,this);
}