扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
(a)中文菜单 |
(b)英文菜单 |
图一、多语言菜单支持的应用程序 |
IDR_MAINFRAME MENU PRELOAD DISCARDABLE BEGIN POPUP "文件(&F)" BEGIN MENUITEM "新建(&N)\tCtrl+N", ID_FILE_NEW MENUITEM "打开(&O)...\tCtrl+O", ID_FILE_OPEN MENUITEM "保存(&S)\tCtrl+S", ID_FILE_SAVE MENUITEM "另存为(&A)...", ID_FILE_SAVE_AS MENUITEM SEPARATOR MENUITEM "打印(&P)...\tCtrl+P", ID_FILE_PRINT MENUITEM "打印预览(&V)", ID_FILE_PRINT_PREVIEW MENUITEM "打印设置(&R)...", ID_FILE_PRINT_SETUP MENUITEM SEPARATOR MENUITEM "最近文件", ID_FILE_MRU_FILE1,GRAYED MENUITEM SEPARATOR MENUITEM "退出(&X)", ID_APP_EXIT END POPUP "编辑(&E)" BEGIN MENUITEM "撤消(&U)\tCtrl+Z", ID_EDIT_UNDO MENUITEM SEPARATOR MENUITEM "剪切(&T)\tCtrl+X", ID_EDIT_CUT MENUITEM "复制(&C)\tCtrl+C", ID_EDIT_COPY MENUITEM "粘贴(&P)\tCtrl+V", ID_EDIT_PASTE END POPUP "查看(&V)" BEGIN MENUITEM "工具栏(&T)", ID_VIEW_TOOLBAR MENUITEM "状态栏(&S)", ID_VIEW_STATUS_BAR END POPUP "帮助(&H)" BEGIN MENUITEM "关于 MutiLanguageMenu(&A)...", ID_APP_ABOUT END END |
"IDR_Englishi_MAINFRAME MENU PRELOAD DISCARDABLE" BEGIN POPUP "File(&F)" BEGIN MENUITEM "New(&N)\tCtrl+N", ID_FILE_NEW MENUITEM "Open(&O)...\tCtrl+O", ID_FILE_OPEN MENUITEM "Save(&S)\tCtrl+S", ID_FILE_SAVE MENUITEM "Save As(&A)...", ID_FILE_SAVE_AS MENUITEM SEPARATOR MENUITEM "Print(&P)...\tCtrl+P", ID_FILE_PRINT MENUITEM "PrintView(&V)", ID_FILE_PRINT_PREVIEW MENUITEM "Print Setup(&R)...", ID_FILE_PRINT_SETUP MENUITEM SEPARATOR MENUITEM "Recent Files", ID_FILE_MRU_FILE1,GRAYED MENUITEM SEPARATOR MENUITEM "Exit(&X)", ID_APP_EXIT END POPUP "Edit(&E)" BEGIN MENUITEM "Undo(&U)\tCtrl+Z", ID_EDIT_UNDO MENUITEM SEPARATOR MENUITEM "Cut(&T)\tCtrl+X", ID_EDIT_CUT MENUITEM "Copy(&C)\tCtrl+C", ID_EDIT_COPY MENUITEM "Paste(&P)\tCtrl+V", ID_EDIT_PASTE END POPUP "View(&V)" BEGIN MENUITEM "ToolBar(&T)", ID_VIEW_TOOLBAR MENUITEM "StatusBar(&S)", ID_VIEW_STATUS_BAR END POPUP "Help(&H)" BEGIN MENUITEM "About MutiLanguageMenu(&A)...", ID_APP_ABOUT END END |
BOOL LoadMenu( UINT nIDResource ); |
BOOL SetMenu( CMenu* pMenu ); |
///////////////////////////////////////////////////////// int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } // TODO: Delete these three lines if you don't want the toolbar to // be dockable m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); if(m_Current==c) m_CurrentMenu.LoadMenu(IDR_MAINFRAME); else m_CurrentMenu.LoadMenu("IDR_English_MAINFRAME"); SetMenu(&m_CurrentMenu);//设置界面菜单; return 0; } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者