如何显示软件窗口菜单?
#474
Replies: 1 comment
-
DirectUI 重点在 Direct, 没有了传统 Win32 依附体无法展示,就算展示这个样式可能也不太好看. 参考 NIM Demo 自绘菜单:https://github.com/netease-kit/NIM_PC_Demo/blob/master/nim_win_demo/gui/main/main_form_menu.cpp#L12-L27 用了类 DirectUI 框架, 就忘记 MFC/Win32 Native Controls |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
调用如下代码,函数都调用正确,但无法显示菜单。
HMENU hMenu = CreateMenu();
HMENU hMenuPop = CreateMenu();
AppendMenu(hMenuPop, MF_STRING, IDM_FILE_NEW, _T("New"));
AppendMenu(hMenuPop, MF_STRING, IDM_FILE_OPEN, _T("Open"));
AppendMenu(hMenu, MF_POPUP, (unsigned int)hMenuPop, _T("File"));
hMenuPop = CreateMenu();
AppendMenu(hMenuPop,MF_STRING,IDM_EDIT_COPY,_T("Copy"));
AppendMenu(hMenuPop,MF_STRING,IDM_EDIT_CUT,_T("Cut"));
AppendMenu(hMenu,MF_POPUP,(unsigned int)hMenuPop,_T("Edit"));
::SetMenu(this->GetHWND(), hMenu);
Beta Was this translation helpful? Give feedback.
All reactions