Pop-up menus (also known as shortcut menus) display frequently-used commands with a right mouse click. They can be context sensitive to the location of the pointer. Using pop-up menus in your application requires building the menu itself and then connecting it to application code.
Once you have created the menu resource, your application code needs to load the menu resource and use the TrackPopupMenu command to cause the menu to appear. Once the user has dismissed the pop-up menu by clicking outside it, or has clicked on a command, that function will return. If the user chooses a command, that command message will be sent to the window whose handle was passed.
Repeat this process for any other menu items in the pop-up menu.
The goal is to have a pop-up menu descending beneath a blank menu bar.
To connect a pop-up menu to your application
CMenu menu;
VERIFY(menu.LoadMenu(IDR_MENU1));
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, AfxGetMainWnd());
See Also Accelerator Editor, Binary Data Editor, Dialog Editor, Menu Editor, String Editor, Toolbar Editor, Version Editor