Why libraries in windows 7




















Next, we enumerate through the different items in the Shell folder, which in the case of a Library can be either files or folders. This is telling the shell folder that we want to return all of the files and folders in a library.

This return is used later to obtain an enumerator to traverse through the entire contents of the Library. As mentioned above, this helper function, and others related to Windows 7 Libraries, can be found in the shlobj.

Here is a list of the important Library helper functions:. Let's review the following code Figure 7 that uses a few of these helper functions to create a new Library, associates a folder with that Library, and "saves" the Library in the Libraries Folder.

Next we add the public Documents folder to the Library object. Then we save the new Library in the Libraries folder, with the rest of the Libraries, and give it the name My New Library. Most of the methods in the IShellLibrary interface are self-explanatory.

However, let's review some that require our attention:. As shown in Figure 7 , the code creates a new library file in the Libraries folder.

A library in Windows 7 is stored as an XML definition file that has a file extension of. The file name is the actual name of the library. Let's dig into the Documents Library definition file schema. The XML structure is pretty self-explanatory, but let's explain a few of its elements. As shown in Figure 8 , at the top of the file we can find the Library "header" information:. The root XML element is libraryDescription, which contains child elements that define the library, as follows:.

Users can't change the default libraries icon via Windows Explorer, nor can they assign the icon to a new customized user-defined library. However, this can be done programmatically using the API, which we will cover in future parts of this series.

A key part of the XML is the list of locations that the Library represents, as shown in the following code:. One final note: Applications should never attempt to access or edit Library description files. A user can add, remove, and reorder locations, as well as change the default save location through the Library Management UI. This is shown in Figure 9 , which is available directly from Windows Explorer. In addition, library locations may be modified through the IShellLibrary interface.

Any change to a library structure is reflected in the library definition file and persists directly to the underlying. You can be informed of such changes by monitoring any changes to the. Assume your application is relying on the content of a library, or your application is currently displaying the content of a given library.

You would like to be notified once the content of the library changes. Applications that wish to be notified about changes to the library definition file can do so by using the native SHChangeNotifyRegister Shell helper function or by using the Managed FileSystemWatcher found in the System.

IO namespace. Using these interfaces is out of the scope of this article since these are not new APIs and are well documented. Another option to consider is the case in which your application needs to manage folders for users, like adding a new folder of pictures into the picture repository.

If you are using the Pictures Library, you can use the library management dialog in your application to show the same dialog that Windows 7 offers users to manage their libraries. By doing so, you keep a consistent look and behavior that the user grows to appreciate. If you choose to use the library management dialog interface, changes to the Library will be made as if you were modifying the Library contents directly within Windows Explorer.

This dialog will not return any information to your application. In case you are showing the contents of a given library, you will need to register for notification to receive updates, as explained above. In this article, you were introduced to the concept and programming model of Libraries in Windows 7. You reviewed the important role that libraries play as part of the Windows 7 user experience.

Then you took a deep-dive into Libraries, understanding what Libraries are and exploring their supporting underlying architecture. Then you saw the different opportunities that developers have, to make their applications Library-aware.

Finally, you went through a short tour of the different available programming models and APIs. He has more than a decade of experience in software development.

He has written and taught academic computer science courses and is an active contributor to The Windows Blog. Alon has a deep understanding of computer technology and holds a BSc degree in electrical and computer engineering from Technion, the Israel Institute of Technology.

Skip to main content. This browser is no longer supported. Libraries are collections of your stored content that can be easily accessed through the Desktop Search function. Libraries do not replace your folders; they simply house them in a single collection. When files are placed in a Library, their properties are indexed by the Search function.

This indexing makes accessing files in Search quick and easy. Later in this lesson, we will also show you how to create Libraries of your own. Understanding Windows Explorer will help you navigate through your content and work with your files and folders in an easy manner. Click the buttons in the interactive below to learn more about the Windows Explorer interface.

The Details pane allows you to view additional information and add tags and ratings to the currently selected item. Use the Back and Forward buttons to navigate between folders.

Shortcuts will appear in the toolbar depending on the item types in the Library pane. Use the Address bar to see the path of the current folder. Items can now be organized by Libraries. Depending on the Library, you can arrange content by month, day, rating, and more. Use the search bar to search for specific files or folders.

Click to see a preview of items in your folders. Click to change the way items are displayed. You can access folders in the traditional way using tiered stacks of content in the Navigation pane. You have several options for how you can view content in your folders. For example, you may prefer seeing Details when viewing file documents and Extra Large Icons when viewing pictures. Depending on the Library, you can Arrange content by month, day, rating, and other factors.

Search and Libraries have a few features that assist with identifying and arranging items. Tags can be added to certain items in order to improve search results. You can also rate and arrange content, like Pictures and Music, in the same manner. The Tag or Rating options are included in the Details pane, as shown below.

Various search filters can be applied to assist with finding content or narrowing a search. As such, Libraries can be a warehouse for photos, or become the nerve center for a music or video collection. This organizing function, much more than any other, highlights the importance of having some or all files or folders be part of a particular Library.

The Downloads library, which shows downloads from multiple locations on yoru PC. Organizing a collection residing in several sources is a good example of how a Library can make organization of the entire collection much simpler. Take digital photographs as one example. The overall photo collection for many families in the current day and age may consist of sub-collections stored among several smartphones as well as the memory cards of a dedicated camera. If a user downloads the photos from all three phones to their computer, their PC will likely have three file locations, or three separate folders, each containing photos.

The archive of photos from a dedicated camera may be located in an external hard drive, with its own folders. No matter where on the computer those phone files get dumped into, pictures from all three phones and the external hard drive can be part of the My Pictures Library. From within the Library, a user can track, organize or arrange their photographs residing in all four places in one place.

For example, files stored in the memory stick of a printer cannot be seen by a Library. Similarly, files on a second computer, even if it shares the same Wi-Fi network, cannot be seen as part of the Libraries on the main computer.

Much more than mere folders, Windows 7 Libraries can make the most unwieldy of electronic collections something more manageable. PC Reviver. Driver Reviver. Disk Reviver. Security Reviver. Start Menu Reviver. Privacy Reviver. Registry Reviver. Battery Optimizer. Total PC Care. Video Blogs. File Extensions. See all ReviverSoft resources. About Us.



0コメント

  • 1000 / 1000