在登陆以前,让所有的菜单(pop-up类型)都灰色显示,程序中如何实现?
解决方案 »
- mscomm控件通讯时,如何在接收新数据前清空接收缓冲区?(附有代码,望指教)
- 进程与内存空间
- 加载图片出错?
- 菜鸟~~这个简单链表的 类模板 怎么搞不定啊?
- 怎么得到FTP服务器的空间大小.用CFtpConnection进行FTP操作.
- 我真的不知道,别骂我,20分,vc和vc++一样么?
- 我现在要做一个发送和接受email的程序,而且还要能发送附件,那位朋友有这方面的经验!
- 得到IHTMLDocument接口之后怎么样高亮显示网页上的部分文字?
- 哪里能下载到《Visual C++ 6.0 数据库编程大全》这本书的配套示例代码???
- 请问如何在CString 里使用中文?
- 为今天这个日子(060606)散分
- 谁有超线程方面的例子或者文档,共享一下看看!
UINT uIDEnableItem,
UINT uEnable
);
ParametershMenu
[in] Handle to the menu.
uIDEnableItem
[in] Specifies the menu item to be enabled, disabled, or grayed, as determined by the uEnable parameter. This parameter specifies an item in a menu bar, menu, or submenu.
uEnable
[in] Controls the interpretation of the uIDEnableItem parameter and indicate whether the menu item is enabled, disabled, or grayed. This parameter must be a combination of either MF_BYCOMMAND or MF_BYPOSITION and MF_ENABLED, MF_DISABLED, or MF_GRAYED.
MF_BYCOMMAND
Indicates that uIDEnableItem gives the identifier of the menu item. If neither the MF_BYCOMMAND nor MF_BYPOSITION flag is specified, the MF_BYCOMMAND flag is the default flag.
MF_BYPOSITION
Indicates that uIDEnableItem gives the zero-based relative position of the menu item.
MF_DISABLED
Indicates that the menu item is disabled, but not grayed, so it cannot be selected.
MF_ENABLED
Indicates that the menu item is enabled and restored from a grayed state so that it can be selected.
MF_GRAYED
Indicates that the menu item is disabled and grayed so that it cannot be selected.
Return ValueThe return value specifies the previous state of the menu item (it is either MF_DISABLED, MF_ENABLED, or MF_GRAYED). If the menu item does not exist, the return value is -1.
m_menuPopup.LoadMenu(IDR_***);
m_menuPopup.GetSubMenu(0)->EnableMenuItem(ID_***,MF_DISABLED | MF_GRAYED);
这个是系统自动生成的,然后再函数体内加入如下:
就可以了,如果要给MENU灰化,在初始化时将m_bAutoMenuEnable = FALSE;添加到构造函数里.
void CMainFrame::OnUpdateHotkeyAddstation(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->Enable(FALSE);
}