當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。