LPPOINT lpoint = new tagPOINT;
::GetCursorPos(lpoint);//得到鼠标位置
CMenu menu;
menu.CreatePopupMenu();//声明一个弹出式菜单
menu.AppendMenu(MF_STRING, MID_EXIT, "退出");
//确定弹出式菜单的位置
SetForegroundWindow(); //点屏幕其他地方,菜单会消失
menu.TrackPopupMenu(TPM_LEFTALIGN, lpoint->x, lpoint->y, this);
//资源回收
HMENU hmenu = menu.Detach();
menu.DestroyMenu();
delete lpoint;
CMenu创建弹出菜单
最新推荐文章于 2016-10-31 22:54:00 发布