object = accMenuPopup(wndID);
Will search for a child accessible object having the ROLE_SYSTEM_MENUPOPUP role.
A popup menu object is used both for menu bar sub-menus, and for right-click context menus. Note that accChildCount will return the number of items on the menu, but will count separators as well.
wnd Overview | MS Accessibility