右键菜单:在控件事件里 NM_RCLCLK 添加函数:弹出菜单(IDR_youjian, this);
//第二个参数填写 this void 弹出菜单(UINT 菜单id,CWnd *窗口){ POINT point; GetCursorPos(&point); CMenu 菜单; 菜单.LoadMenuW(菜单id); CMenu* 子菜单 = 菜单.GetSubMenu(0); 子菜单->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, 窗口); }