【发布时间】:2025-12-29 06:25:12
【问题描述】:
我正在尝试使用
为 win32 应用程序创建上下文菜单case WM_RBUTTONDOWN:
{
HMENU hPopupMenu = CreatePopupMenu();
InsertMenu(hPopupMenu, 0, MF_BYPOSITION | MF_STRING, ID_CLOSE, (LPCWSTR)"Exit");
InsertMenu(hPopupMenu, 0, MF_BYPOSITION | MF_STRING, ID_EXIT, (LPCWSTR)"Play");
SetForegroundWindow(hWnd);
TrackPopupMenu(hPopupMenu, TPM_BOTTOMALIGN | TPM_LEFTALIGN, 0, 0, 0, hWnd, NULL);
}
但我总是得到如下所示的上下文菜单
alt text http://img191.imageshack.us/img191/866/70219076.png
我希望文本 exit 和 play 显示在菜单中
【问题讨论】:
-
我猜图像现在完全丢失了。很高兴 SO 现在允许粘贴图像。
标签: winapi contextmenu