我正在尝试使用win32应用程序创建上下文菜单
原文链接:https://www.f2er.com/windows/364403.htmlcase WM_RBUTTONDOWN: { HMENU hPopupMenu = CreatePopupMenu(); InsertMenu(hPopupMenu,MF_BYPOSITION | MF_STRING,ID_CLOSE,(LPCWSTR)"Exit"); InsertMenu(hPopupMenu,ID_EXIT,(LPCWSTR)"Play"); SetForegroundWindow(hWnd); TrackPopupMenu(hPopupMenu,TPM_BOTTOMALIGN | TPM_LEFTALIGN,hWnd,NULL); }
但我总是得到如下所示的上下文菜单
alt text http://img191.imageshack.us/img191/866/70219076.png