弹出菜单不显示内容,空菜单

时间:2017-07-31 13:42:22

标签: c++ visual-studio-2015

我正在Windows 10上的visual studio 2015上编码。我创建了我的弹出菜单,由于AppendMenu功能,我填写了它。菜单具有正确的形状,但不显示字符串。有没有人有解决方案?

这是我的代码:

HMENU popMenu = CreatePopupMenu();
AppendMenu(popMenu, MF_STRING, ID_MENU_SHOW, "Show");
AppendMenu(popMenu, MF_STRING, ID_MENU_EXIT, "Exit");
POINT pCursor;
GetCursorPos(&pCursor);
SetForegroundWindow(msg->hwnd);
TrackPopupMenu(popMenu, TPM_BOTTOMALIGN | TPM_RIGHTALIGN | TPM_NONOTIFY |TPM_RETURNCMD | TPM_RIGHTBUTTON | TPM_VERNEGANIMATION, pCursor.x, pCursor.y, 0, msg->hwnd, NULL);

0 个答案:

没有答案