I'm trying to replicate the win 7 explorer context menu on the fly. All works well apart from the "Include in Library" submenu, which shows one greyed out entry: "retrieving libraries...". Well it's not retrieving anything because the code to read the menus has returned! Here is my code that reads the menu entries...

def __getMenuItems(hMenu, contextMenu):
    num_items = win32gui.GetMenuItemCount(hMenu)
    rval = []
    for i in range(num_items):
        mi = EmptyMENUITEMINFO()
        win32gui.GetMenuItemInfo(hMenu, i, True, mi[0])
        item = UnpackMENUITEMINFO(mi[0])
        fType, fState, wID, hSubMenu, hbmpChecked, hbmpUnchecked, dwItemData, 
text, hbmpItem = item
        if hSubMenu:
            hSubMenu = win32gui.GetSubMenu(hMenu, i)
            rval.append((__getMenuItems(hSubMenu, contextMenu), text))
        else:
            rval.append((wID, text))
    return rval


I have no idea what to do and google is no help. Do I need to initiate something? Wait for something? Any help much appreciated!

chris

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to