POINT point;
CMenu menuHelp;
GetCursorPos(&point);
menuHelp.LoadMenu(IDR_MENU_SYSTRAY);
CMenu*pSubMenu = menuHelp.GetSubMenu(0);
pSubMenu->TrackPopupMenu(TPM_LEFTALIGN, point.x, point.y, this);
As you can see this piece of code creates the menu at the cursor position, you may have to change that, but the principle is the same.
Also you should know when you create the resource for the menu, that this code shows the first
submenu not the primary menu itself!
For example if you pass the ID of the main program menu
IDR_MAINFRAME
the code above will show the content of the
File menu not the main menu ("File | Edit | View ...")
appending handlers to the menuitems of a menu created that way is
no different than usual. you go to the menu resource, right click on an item and add event handler that's it.
Appending menu items:
You can see how it's done in a newly created dialog based application's OnInitDialog function. see how they append the "About..." item to the system menu