Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Windows 7 Libraries .NET Sample Library Ė an Overview

06 Apr 2009   #1
z3r010

 
Windows 7 Libraries .NET Sample Library Ė an Overview

Quote:
Libraries are the primary entry points to user data in Windows 7. They are the natural evolution from the userís Known Folders, including those for documents, pictures, music, and videos. However, before jumping into the technicalities, letís try to explain what a Library in Windows 7 is. A Windows 7 Library is a user-defined collection of content that represents the userís data independently from the folder hierarchy. Users can unify and flatten the folder hierarchy by aggregating any number of physical locations (on their local machine or on remote machines) into a single view Ė which is the library. By including folders in Libraries, users tell Windows where their important data are located. In Windows 7 therefore, most applications should use a Library instead of the userís Known Folders. It is important to note that as Libraries are an integral part of the Windows Shell, they play a greater role in the Windows 7 Explorer user experience. Accordingly, the importance and integration points of Libraries span multiple parts of the Windows Shell, including the Common File Dialog, Folder Picker, and the Windows Explorer Browser control (not Internet Explorer!).

This is the first post in a series of Library posts. It provides an overview of both the Windows 7 Library functionality and the Libraries Sample .NET Interop Library, which is a managed code wrapper and part of the Windows 7 .NET Interop Sample Libraries. The second post is all about Understanding Windows 7 Libraries. In future posts, we will dive into the internal implementation of Libraries as well as how to use the Libraries programming model and APIs.

If you are unfamiliar with and havenít seen any demonstrations of the updated Windows 7 Shell and Libraries in action, I suggest you watch the Windows 7: Find and Organize Part 1 webcast on Channel 9. This will give you some context for the technical material we cover here.

Letís review the Windows 7 Libraries .NET Interop Sample Library architecture and note the important classes. Please remember that the Libraries sample is part of the Taskbar and Libraries assembly. Since both Taskbar and the Libraries share many common integration points with the Windows Shell, it makes sense to have them grouped together and use the same Shell structures and methods.

Opening the solution reveals the following structure:

  • The Demos folder containing several demo projects that show the various aspects of both the Taskbar and Libraries wrappers as you can see from the image; we will focus on the Libraries
  • The Wrappers folder containing the Windows7.DesktopIntegration assembly, which is the main manager API for both the Taskbar and Libraries
  • A modified version of the Vista Bridge Sample Library - We based our code on the 1.4 version. And as mentioned before, the Windows Vista bridge Project will be superseded by the new Windows API Code Pack for the .NET Library
Letís take a quick look at the main class that enables developers to take advantage of the new Library functionality. The ShellLibrary.cs file contains the ShellLibrary class, which is the main entry point for managed code developers. Using the ShellLibrary, developers can programmatically perform all Library operations, including:

  • Create new library
  • Load existing library
  • Delete library
  • Add / remove folders from the library
  • Set the default save location of the library
  • Set the folder type
  • Show the library management dialog box
  • Set the library icon
  • Pin and unpin the library from the left navigation pan in Windows Explorer
 

The demos in the Libraries folder highlight all the above-mentioned Library functionality. Letís review them:

  • The LibraryManagerDemo is a Windows Presentation Foundation (WPF) application that showcases all the functionality offered by libraries. It is a very simple application that offers developers a great


 

  • The SLUtil (not Silverlight) is a command line interface that allows users and developers to manage their Libraries. Again, it offers all the above-mentioned Library functionality.


 

Here are some additional resources for programming Windows 7 Libraries:

View Channel 9 videos:

Additional blog posts

 

Alon Fliess contributed to this post


More...


My System SpecsSystem Spec
.
07 Apr 2009   #2
Romulinx2

Win7 Ultimate x64 on Desktop / Win7 Ultimate x86 on laptop / Win7 x86 Starter on Netbook
 
 

Thanks, nice to have some more control.

Looking at command line controls, do you think the DOS type commands will ever disappear?
My System SpecsSystem Spec
07 Apr 2009   #3
baarod

El Capitan / Windows 10
 
 

Quote   Quote: Originally Posted by Romulinx2 View Post
Thanks, nice to have some more control.

Looking at command line controls, do you think the DOS type commands will ever disappear?
Not as long as there are sysadmins that need to script stuff!
My System SpecsSystem Spec
.

07 Apr 2009   #4
garysgold

Vista Ult 64 bit Seven Ult RTM x64
 
 

Libraries are something I really like about W7. A real time saver for me.
My System SpecsSystem Spec
Reply

 Windows 7 Libraries .NET Sample Library Ė an Overview




Thread Tools




Similar help and support threads
Thread Forum
Video library folder missing from libraries
Hello all, This has been bugging me for some time so hopefully somebody can help me. In my Libraries folder in Windows 7 it has Documents, Pictures and Music. It does not have a videos library though. If somebody can help me with getting my videos folder then that would be brilliant. I have done...
General Discussion
How to unlink WMP library from Windows Libraries
After messing up with Windows Media Player 12 and the Windows Libraries I finally found the way to unlink Windows Libraries from Windows Media Player Library. As you remember it has been commented to disable the Windows Media Player Network Sharing Service but I realized that isn't enough to...
Music, Pictures & Video
Libraries do not work. I just see music.library-ms.
Hi, I recently did a check for registry errors after upgrading my hard disk and reinstalling Windows 7 and all of my programs. It found over 1000 which are now fixed. However since doing this I can no longer access my libraries. I am faced with, in both my Computer and in the start menu where...
General Discussion
Hiding 'Library Location Details' in Libraries
Okay, maybe I'm just tired and have been messing around with the computer too much now. Can anyone help, I just can't work this out. In Libraries you have Documents, Music etc. Ok. In Documents I have the folders C:\Users\Mark\My Documents selected. In this library the location is hidden...
General Discussion
Windows 7 Taskbar .NET Sample Library Ė an Overview
More...
News
Windows 7 .NET Interop Sample Libraries
We've got .NET sample libraries and example for managed code developers to target Windows 7 new APIs! Windows 7 offers new functionality that developers can exploit in their applications to provide enhanced experiences and productivity for their end users. Included among these new features is...
News


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 04:18.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App