Skip to content

Latest commit

 

History

History
333 lines (168 loc) · 7.25 KB

PyIShellLibrary.md

File metadata and controls

333 lines (168 loc) · 7.25 KB

PyIShellLibrary

PyIShellLibrary Object

Interface used to access Libraries

Comments

Requires Windows 7 or later

Methods

PyIShellLibrary.AddFolder

AddFolder(Location) Includes a folder

Parameters

  • Location : PyIShellItem

    Shell item interface representing the folder

Commit() Saves changes (only if loaded from an existing library)

PyIShellLibrary.GetDefaultSaveFolder

PyIShellItem = GetDefaultSaveFolder(Type, riid

) Returns the default folder in which new items are saved

Parameters

  • Type=DSFT_DETECT : int

    Specifies whether to return public or private save location, shellcon.DSFT_*

  • riid=IID_IShellItem : PyIID

    The interface to return

PyIShellLibrary.GetFolderType

PyIID = GetFolderType() Returns the library type, shell.FOLDERTYPEID_*

PyIShellLibrary.GetFolders

PyIShellItemArray = GetFolders(Filter, riid

) Retrieves a collection of folders in the library

Parameters

  • Filter=LFF_ALLITEMS : int

    Specifies what types of folder to return (shellcon.LFF_*)

  • riid=IID_IShellItemArray : PyIID

    The interface to return, IObjectCollection and IObjectArray also accepted.

str = GetIcon() Returns the location of the library's icon

Return Value

Uses "module,resource" format

PyIShellLibrary.GetOptions

int = GetOptions() Retrieves library option flags

Return Value

Returns a combination of shellcon.LOF_* flags

PyIShellLibrary.LoadLibraryFromItem

LoadLibraryFromItem(Library, Mode) Loads an existing library file

Parameters

  • Library : PyIShellItem

    Shell item interface representing the library file

  • Mode : int

    Access mode, combination of storagecon.STGM_* flags

PyIShellLibrary.LoadLibraryFromKnownFolder

LoadLibraryFromKnownFolder(Library, Mode) Initializes library from a known folder

Parameters

  • Library : PyIID

    Known folder id, shell.FOLDERID_*

  • Mode : int

    Access mode, combination of storagecon.STGM_* flags

PyIShellLibrary.RemoveFolder

RemoveFolder(Location) Removes a folder

Parameters

  • Location : PyIShellItem

    Shell item interface representing the folder

PyIShellLibrary.ResolveFolder

PyIShellItem = ResolveFolder(FolderToResolve, Timeout

, riid

) Attempts to locate a folder that has been moved or renamed

Parameters

  • FolderToResolve : PyIShellItem

    Library item whose location has changed

  • Timeout : int

    Max search time, specified in milliseconds

  • riid=IID_IShellItem : PyIID

    The interface to return

PyIShellItem = Save(FolderToSaveIn, LibraryName

, Flags

) Saves the library to a specific location

Parameters

  • FolderToSaveIn : PyIShellItem

    The destination folder, use None to save in current user's Libraries folder

  • LibraryName : str

    Filename for the new library, without file extension

  • Flags : int

    Determines behaviour if file already exists, shellcon.LSF_*

Return Value

Returns a shell item for the saved file.

PyIShellLibrary.SaveInKnownFolder

PyIShellItem = SaveInKnownFolder(FolderToSaveIn, LibraryName

, Flags

) Saves the library in a known folder

Parameters

  • FolderToSaveIn : PyIID

    The destination folder, shell.FOLDERID_*

  • LibraryName : str

    Filename for the new library, without file extension

  • Flags : int

    Determines behaviour if file already exists, shellcon.LSF_*

PyIShellLibrary.SetDefaultSaveFolder

SetDefaultSaveFolder(Type, SaveFolder) Sets the default save location

Parameters

  • Type : int

    Specifies public or private save location, shellcon.DSFT_*

  • SaveFolder : PyIShellItem

    New default location, must be in the library

PyIShellLibrary.SetFolderType

SetFolderType(Type) Sets the folder type for the library

Parameters

  • Type : PyIID

    New type, shell.FOLDERTYPEID_*

SetIcon(Icon) Sets the library icon

Parameters

  • Icon : str

    Icon location in "module,resource" syntax

PyIShellLibrary.SetOptions

SetOptions(Mask, Options) Sets library option flags

Parameters

  • Mask : int

    Bitmask of flags to be changed, combination of shellcon.LOF_* values

  • Options : int

    New options, combination of shellcon.LOF_* values