本文整理汇总了Python中win32com.shell.shellcon.CSIDL_DESKTOP属性的典型用法代码示例。如果您正苦于以下问题:Python shellcon.CSIDL_DESKTOP属性的具体用法?Python shellcon.CSIDL_DESKTOP怎么用?Python shellcon.CSIDL_DESKTOP使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类win32com.shell.shellcon
的用法示例。
在下文中一共展示了shellcon.CSIDL_DESKTOP属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ExplorePIDL
# 需要导入模块: from win32com.shell import shellcon [as 别名]
# 或者: from win32com.shell.shellcon import CSIDL_DESKTOP [as 别名]
def ExplorePIDL():
pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP)
print "The desktop is at", shell.SHGetPathFromIDList(pidl)
shell.ShellExecuteEx(fMask=shellcon.SEE_MASK_NOCLOSEPROCESS,
nShow=win32con.SW_NORMAL,
lpClass="folder",
lpVerb="explore",
lpIDList=pidl)
print "Done!"
示例2: test_idlist_roundtrip
# 需要导入模块: from win32com.shell import shellcon [as 别名]
# 或者: from win32com.shell.shellcon import CSIDL_DESKTOP [as 别名]
def test_idlist_roundtrip(self):
pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP)
item = shell.SHCreateItemFromIDList(pidl, shell.IID_IShellItem)
pidl_back = shell.SHGetIDListFromObject(item)
self.assertEqual(pidl, pidl_back)
示例3: test_parsing_relative
# 需要导入模块: from win32com.shell import shellcon [as 别名]
# 或者: from win32com.shell.shellcon import CSIDL_DESKTOP [as 别名]
def test_parsing_relative(self):
desktop_pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP)
desktop_item = shell.SHCreateItemFromIDList(desktop_pidl, shell.IID_IShellItem)
sf = shell.SHGetDesktopFolder()
flags = shellcon.SHCONTF_FOLDERS | shellcon.SHCONTF_NONFOLDERS
children = sf.EnumObjects(0, flags)
child_pidl = children.next()
name_flags = shellcon.SHGDN_FORPARSING | shellcon.SHGDN_INFOLDER
name = sf.GetDisplayNameOf(child_pidl, name_flags)
item = shell.SHCreateItemFromRelativeName(desktop_item, 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(name_flags))
示例4: test_create_item_with_parent
# 需要导入模块: from win32com.shell import shellcon [as 别名]
# 或者: from win32com.shell.shellcon import CSIDL_DESKTOP [as 别名]
def test_create_item_with_parent(self):
desktop_pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP)
desktop_item = shell.SHCreateItemFromIDList(desktop_pidl, shell.IID_IShellItem)
sf = shell.SHGetDesktopFolder()
flags = shellcon.SHCONTF_FOLDERS | shellcon.SHCONTF_NONFOLDERS
children = sf.EnumObjects(0, flags)
child_pidl = children.next()
item1 = shell.SHCreateItemWithParent(desktop_pidl, None, child_pidl, shell.IID_IShellItem)
item2 = shell.SHCreateItemWithParent(None, sf, child_pidl, shell.IID_IShellItem)
self.assertShellItemsEqual(item1, item2)
示例5: get_desktop
# 需要导入模块: from win32com.shell import shellcon [as 别名]
# 或者: from win32com.shell.shellcon import CSIDL_DESKTOP [as 别名]
def get_desktop():
'''Return user Desktop folder'''
return shell.SHGetFolderPath(0, shellcon.CSIDL_DESKTOP, None, 0)