Menu
A simple wrapper around a menu handle
The Menu class is accessible via the pywinauto.controls.menuwrapper module.
A menu supports methods for querying the menu and getting it's menu items.
Methods
f __init__(self, owner_ctrl, menuhandle, is_main_menu=True, owner_item=None) ...
Initialize the class.
- owner_ctrl is the Control that owns this menu
- menuhandle is the menu handle of the menu
- is_main_menu we have to track whether it is the main menu or a popup menu
- owner_item The item that contains this menu - this will be None for the main menu, it will be a MenuItem instance for a submenu.
f Item(self, index) ...
Return a specific menu item
- index is the 0 based index of the menu item you want
f GetProperties(self) ...
Return the properties for the menu as a list of dictionaries
This method is actually recursive. It calls GetProperties() for each of the items. If the item has a sub menu it will call this GetProperties to get the sub menu items.
f GetMenuPath(self, path, path_items=None, appdata=None) ...
Walk the items in this menu to find the item specified by path
See the source for more information.