CMenu::Detach

分离 CMenu 对象的一个Windows菜单并返回处理。

HMENU Detach( );

返回值

处理,对于Windows菜单的类型,HMENU,如果成功,则;否则 NULL

备注

m_hMenu 数据成员设置为 NULL

示例

CMenu mnu;
HMENU hmnu = AfxGetMainWnd()->GetMenu()->GetSafeHmenu();
mnu.Attach(hmnu);

// Now you can manipulate the window's menu as a CMenu
// object...

mnu.Detach();

要求

Header: afxwin.h

请参见

参考

CMenu选件类

层次结构图

CMenu::Attach