当前位置: 首页>>代码示例>>Python>>正文


Python shellcon.CSIDL_DESKTOP属性代码示例

本文整理汇总了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!" 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:11,代码来源:shellexecuteex.py

示例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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:7,代码来源:testShellItem.py

示例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)) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:17,代码来源:testShellItem.py

示例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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:testShellItem.py

示例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) 
开发者ID:newville,项目名称:pyshortcuts,代码行数:5,代码来源:windows.py


注:本文中的win32com.shell.shellcon.CSIDL_DESKTOP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。