def test_parsing_name(self):
sf = shell.SHGetDesktopFolder()
flags = shellcon.SHCONTF_FOLDERS | shellcon.SHCONTF_NONFOLDERS
children = sf.EnumObjects(0, flags)
child_pidl = children.next()
name = sf.GetDisplayNameOf(child_pidl, shellcon.SHGDN_FORPARSING)
item = shell.SHCreateItemFromParsingName(name, None, shell.IID_IShellItem)
# test the name we get from the item is the same as from the folder.
self.assertEqual(name, item.GetDisplayName(shellcon.SHGDN_FORPARSING))
评论列表
文章目录