Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO : Insert menu items at a non-default position in the contextmenu using a context menu extension

 
Subscribe to the RSS feed for this forum  Forum Index -> EZShellExtensionsMFC
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Sat Apr 19, 2008 6:20 am    Post subject: HOWTO : Insert menu items at a non-default position in the contextmenu using a context menu extension

By default, the CShellMenu.AddItem method adds menu items at a position specified by Windows. This position is stored in the startIndex member of the CGetMenuitemsEventArgs instance which is passed to the OnGetMenuItems function.

To add a menu item at another position, use CShellMenu.InsertItem method instead. The last parameter of this function specifies the 0-based position where the menu item will be inserted

void CContextMenuExtension1::OnGetMenuItems(CGetMenuitemsEventArgs& e)
{
e.menu->InsertItem(_T("Menu item A"), _T("menuitemA"), _T("Menu Item A"), 13);
//The last parameter specifies the 0-based position of the menu item in the context menu
}
Back to top
Display posts from previous:   
Forum Index -> EZShellExtensionsMFC All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group