关于多文档工程的菜单切换的问题 我现在有一个多文档工程,我想任意的切换主菜单,也就是任意替换主菜单。我看了MSDN上有关于单文档的做法,可是在多文档中好像行不通,请高手指点一下,怎么才能切换多文档的主菜单呢?拜托了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 // 注册应用程序的文档模板。文档模板 // 将用作文档、框架窗口和视图之间的连接 CMultiDocTemplate* pDocTemplate; pDocTemplate = new CMultiDocTemplate(IDR_MAINFRAME, //这是菜单的资源ID,在注册不同的文档时指定主菜单,以后运行时就会被这个菜单所替换 RUNTIME_CLASS(CStockXpDoc), RUNTIME_CLASS(CChildFrame), // 自定义 MDI 子框架 RUNTIME_CLASS(CManageListView)); AddDocTemplate(pDocTemplate); ::SendMessage(hWndMDIClient, WM_MDISETMENU, (WPARAM)hMenuAlt, NULL); First, I am not did it before.Second, It is maybe effective that you copy the codes about the toolbar being generated in the yourapp.cpp to your command-function.Three, Would you want that it likes the WINWORD of MicroSoft? CMenu newMenu; newMenu.LoadMenu (IDR_YOUR); AfxGetApp()->GetMainWnd()->SetMenu( &newMenu ); AfxGetApp()->GetMainWnd()->DrawMenuBar(); newMenu.Detach ();&=={:::::::::::::::::::::::::::::::::::::> ::SendMessage(hWndMDIClient, WM_MDISETMENU, (WPARAM)hMenuAlt, NULL);hWndMDIClient是mdiclient的句柄,就是mdichild的parentwnd。hMenuAlt是你要新设置的菜单句柄 JetCodeSun(影刀) 大侠的可以用,结了 添加游戏闪屏问题 小调查:您用异常吗? 弱弱的问题,抓包找密码 在VC中如何设置 一个DIALOG 为 启动窗口 create files 关于CControlBar类 完成端口,又见完成端口 在com定义的BOOL类型属性,在vb中显示为long,为什么? mht文件的编码? 怎样使程序在按关闭按钮时出现一个"再见,欢迎下次再来" 刚给了100分,重新发问:以下SQL语句有什么问题.....? 程序怎样使用SMPP给UNICOM的SMSC发短息
// 将用作文档、框架窗口和视图之间的连接
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_MAINFRAME, //这是菜单的资源ID,在注册不同的文档时指定主菜单,以后运行时就会被这个菜单所替换
RUNTIME_CLASS(CStockXpDoc),
RUNTIME_CLASS(CChildFrame), // 自定义 MDI 子框架
RUNTIME_CLASS(CManageListView));
AddDocTemplate(pDocTemplate);
(WPARAM)hMenuAlt, NULL);
Second, It is maybe effective that you copy the codes about the toolbar being generated in the yourapp.cpp to your command-function.
Three, Would you want that it likes the WINWORD of MicroSoft?
newMenu.LoadMenu (IDR_YOUR);
AfxGetApp()->GetMainWnd()->SetMenu( &newMenu );
AfxGetApp()->GetMainWnd()->DrawMenuBar();
newMenu.Detach ();
&=={:::::::::::::::::::::::::::::::::::::>
(WPARAM)hMenuAlt, NULL);
hWndMDIClient是mdiclient的句柄,就是mdichild的parentwnd。
hMenuAlt是你要新设置的菜单句柄
结了