How to Read/Write Windows 7 Library Locations?

后端 未结 2 1662
灰色年华
灰色年华 2020-12-09 22:33

Intro

In Windows 7 you have some special folders for documents, pictures and music etc called Libraries.

If you are not aware of them, basic

2条回答
  •  生来不讨喜
    2020-12-09 22:39

    I have just found in Marco Cantu's source code repository for his Mastering Delphi books, an example for Delphi 2010 which shows a way of getting the locations inside a library.

    The link to the repository is here: http://code.marcocantu.com/p/marcodelphibooks/source/tree/HEAD/

    In the delphi2010handbook, chapter 05 (Win7Libraries) is the example source.

    The method used in that demo is basically the use of the Windows API that has already been mentioned, the demo confirms that the Library files are indeed of XML format.


    Additionally I found the following information which is quite useful:

    • SHAddFolderPathToLibrary - Adds a folder to a library.
    • SHCreateLibrary IShellLibrary - Creates an object.
    • SHLoadLibraryFromItem - Creates and loads IShellLibrary to object from a specified library definition file.
    • SHLoadLibraryFromKnownFolder - Creates and loads of IShellLibrary object for a specified KNOWNFOLDERID.
    • SHLoadLibraryFromParsingName - Creates and loads of IShellLibrary object for a specified path.
    • SHRemoveFolderPathFromLibrary - Removes a folder from a library.
    • SHResolveFolderPathInLibrary - Attempts to resolve the target location of a library folder that has been moved or renamed.
    • SHResolveLibrary - Attempts to find the location of a library.
    • SHSaveLibraryInFolderPath - Saves on IShellLibrary object to disk.
    • SHShowManageLibraryUI - Shows the library management dialog, Which Enables users to manage the library folders and default save location.

提交回复
热议问题