用GetSystemMenu得到的系统菜单只能使用下面三个函数,以下是MSDN的原话:
The pointer returned by the GetSystemMenu member function can be used with the
CMenu::AppendMenu, CMenu::InsertMenu, or CMenu::ModifyMenu functions to change the Control menu.
我真是不明白,返回的是CMenu指针,为什么不能使用CMenu的其它函数呢?
如果我想要删除掉系统菜单中的“移动”项,应该怎么办,我看了CMenu::ModifyMenu的说明半天,也没搞懂怎么删除菜单项。
The pointer returned by the GetSystemMenu member function can be used with the
CMenu::AppendMenu, CMenu::InsertMenu, or CMenu::ModifyMenu functions to change the Control menu.
我真是不明白,返回的是CMenu指针,为什么不能使用CMenu的其它函数呢?
如果我想要删除掉系统菜单中的“移动”项,应该怎么办,我看了CMenu::ModifyMenu的说明半天,也没搞懂怎么删除菜单项。
解决方案 »
- MFC中怎么实现画笔的宽度和线形?
- qq 迅雷 的title bar 没有 但是最大化 最小化按钮 是怎么实现的
- 哪位朋友用winhttp post过数据?咋string.c_str()不行啊?服务器收不到但Const char *却行.
- 谁能解释下这个问题!巨诡异!!!!!!!!!!!!!!!!!!!!
- 有些人太可恶,请版主处理。
- 十万火急:MDI的一个问题?????????在线等待!!!!!!
- 小弟初学ActiveX,求助各位大虾,3个基础问题
- 我想导出组件服务中的组件的接口和方法
- 急求!!谁有<<windows网络编程>>第2版的中文书啊
- 帮帮忙..ADO with ATL,100分送上!!
- 100分,关于使用网上CButtonST时显示文字靠左的问题,一直解决不了。 我贴出了一段代码,帮忙看一下
- CreateProcess 重赏之下出勇夫~!
如果是MDI的可以:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
//if( !CMDIFrameWnd::PreCreateWindow(cs) )
//return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style = WS_POPUP | WS_OVERLAPPED | WS_VISIBLE |WS_DLGFRAME;
if(cs.hMenu!=NULL)
{
::DestroyMenu(cs.hMenu); // 如果菜单已经载入,则删除掉
cs.hMenu = NULL; // 设置窗口菜单为NULL }
return CMDIFrameWnd::PreCreateWindow(cs);
}
if (pSysMenu != NULL)
{
ModifyStyle(WS_MINIMIZEBOX, 0);
}
如果是Dialog工程想修该系统菜单,可以使用ClassWizard中的Class Info标签页,将其中的Message filter从原来的Dialog改为Window就可以映射WM_INITMENU消息了,呵呵
{
cs.style = WS_POPUP | WS_OVERLAPPED | WS_VISIBLE |WS_DLGFRAME;
if(cs.hMenu!=NULL)
{
::DestroyMenu(cs.hMenu); // 除掉已经载入的菜单
cs.hMenu = NULL; // 设置窗口菜单句柄为NULL }
return CMDIFrameWnd::PreCreateWindow(cs);
}