def enum_known_folder(folder_id, htoken=None):
    id_list = get_known_folder_id_list(folder_id, htoken)
    folder_shell_item = shell.SHCreateShellItem(None, None, id_list)
    items_enum = folder_shell_item.BindToHandler(None,
        shell.BHID_EnumItems, shell.IID_IEnumShellItems)
    for item in items_enum:
        yield item
Esempio n. 2
0
 def list_known_folder(folder_id, htoken=None):
     result = []
     pidl = get_known_folder_id_list(folder_id, htoken)
     shell_item = shell.SHCreateShellItem(None, None, pidl)
     shell_enum = shell_item.BindToHandler(None, shell.BHID_EnumItems,
         shell.IID_IEnumShellItems)
     for item in shell_enum:
         result.append(item.GetDisplayName(shellcon.SIGDN_NORMALDISPLAY))
     result.sort(key=lambda x: x.upper())
     return result
Esempio n. 3
0
    def enum_known_folder(folder_id, htoken=None):
        id_list = get_known_folder_id_list(folder_id, htoken)
        folder_shell_item = shell.SHCreateShellItem(None, None, id_list)
        items_enum = folder_shell_item.BindToHandler(None,
                                                     shell.BHID_EnumItems,
                                                     shell.IID_IEnumShellItems)
        result = []
        for item in items_enum:
            # print(item.GetDisplayName(shellcon.SIGDN_NORMALDISPLAY))
            result.append(item.GetDisplayName(shellcon.SIGDN_NORMALDISPLAY))

        return result