I didn't have any problems with this yet, because the last couple of hours I tried to figure out what I need to implement to sort the list with my command_items.
Below's the struct I use to describe the node of the treeview. I didn't want to implement the sorting code myself (or use stl here) because I assumed list_t and its descendants can perform sorting, but I can't figure out how to make the default sorting algorithm use my <> operators :
struct command_item {
typedef ptr_list_t<command_item> command_items;
command_items subitems;
string8 name;
// ... Code removed ...
void sortItems() {
// sort subitems by name
// XXX: for some reason this doesn't result in operator < > calls
subitems.sort(command_items::sort_callback_auto());
// subitems.sort();
// now make those subitems that have children sort themselves
// ... Code removed ...
}
// ... Code removed ...
inline bool operator > (const command_item & p_item) const throw() {
return strcmp(name, p_item.name) > 0;
}
inline bool operator < (const command_item & p_item) const throw() {
return strcmp(name, p_item.name) < 0;
}
};
Are there any examples on pfc foundation classes, it's very hard to figure out how to use pfc containers without reading every line of the pfc source code, which is sadly not documented enough.
QUOTE(foosion @ May 17 2007, 11:45)

I think what you are looking for is the default path of an item; see the contextmenu_item::get_item_default_path() method.
Note that context menu items are identified by two GUIDs: the command GUID which you get from contextmenu_item::get_item_guid() and the node or subcommand GUID which you get from contextmenu_item_node::get_guid(). The latter is a null GUID for commands that have no subcommands; also it is only guaranteed to be unique if contextmenu_item_node::is_mappable_shortcut() returns true.
Edit: It seems like I was a bit too slow. Anyway, just ask if you have problems with this. The context menu API still could use more documentation and examples.