Help - Search - Members - Calendar
Full Version: usage of DECLARE_CONTEXT_MENU_ITEM
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
SrAcer
I know there are some ways to create a context menu item. But since a DECLARE_CONTEXT_MENU_ITEM exists, I guess it'll be cool to make use of it. However I'm not a guru of C++ and can't get it to work. Could anybody give me an example of how to use it? Thanks a lot.
SrAcer
OK, I'll answer it myself. DECLARE_CONTEXT_MENU_ITEM is a simple way to add one static context menu item. Here is an example.

CODE

//Replace the GUID with something of your own.
const GUID myguid = { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF } };

void myfunc( const pfc::list_base_const_t<metadb_handle_ptr> & p_data )
{
  //Do nothing.
  return;
}

DECLARE_CONTEXT_MENU_ITEM (contextmenu_myitem, // Class Name
                            "My Context Menu item", // Menu Item Text
                            "My Context Menu Group", // Default Path (Group)
                            myfunc, // Your Function
                            myguid, // Your GUID
                            "This is the description." // as it says)



Simple and neat. I like it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.