执行前先创建并设置菜单资源
CMenu menu,*popmenu;
menu.LoadMenuW(IDR_MENU_RBUTTONDOWN);//IDR_MENU_RBUTTONDOWN为菜单资源
popmenu = menu.GetSubMenu(0);
GetCursorPos(&point);//point为鼠标位置
popmenu->TrackPopupMenu(TPM_LEFTALIGN,point.x,point.y,this);//呼出菜单
执行前先创建并设置菜单资源
CMenu menu,*popmenu;
menu.LoadMenuW(IDR_MENU_RBUTTONDOWN);//IDR_MENU_RBUTTONDOWN为菜单资源
popmenu = menu.GetSubMenu(0);
GetCursorPos(&point);//point为鼠标位置
popmenu->TrackPopupMenu(TPM_LEFTALIGN,point.x,point.y,this);//呼出菜单
转载于:https://www.cnblogs.com/weixinhum/p/3916709.html