Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Mon Dec 10, 2007 8:15 am Post subject: HOWTO : Add sub-menus/multi-level menus to a context menu extension developed using EZShellExtensionsMFC |
|
|
To add multi-level menu entries in a context menu extension, you should use the SetHasSubMenu method of CShellMenuItem. Use the following code in the OnGetMenuItems method override of your CContextMenuExtension derived class :
CShellMenuItem* parent = e.menu->AddItem(_T("Parent menu item"));
parent->SetHasSubMenu(true);
parent->GetSubMenu()->AddItem(_T("Menu item 1"),_T("menuitem1"),_T("Menu Item 1"));
parent->GetSubMenu()->AddItem(_T("Menu item 2"),_T("menuitem2"),_T("Menu Item 2")); |
|