void
CXxDialog::OnClickedButton1()
//该函数为你的BUTTON点击响应函数
{
CMenu menu;
menu.LoadMenu(IDR_LISTCTRL_POPUP
/*此处填写你的菜单的资源编号*/
);
CMenu *pMenuPopup = menu.GetSubMenu(0);
ASSERT(pMenuPopup);
CPoint point;
GetCursorPos(&point);
pMenuPopup->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,point.x,point.y,
this
,NULL);
menu.DestroyMenu();
}