Download presentation
Presentation is loading. Please wait.
Published byMaximillian Bryce Robertson Modified over 6 years ago
2
Yochay Kiriaty Senior Technical Evangelist Microsoft® Corporation
4/15/2018 3:40 AM Empowering Users to Find, Visualize, and Organize Their Data with Libraries and the Explorer Yochay Kiriaty Senior Technical Evangelist Microsoft® Corporation © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
3
Agenda Library overview Common File Dialogs Libraries API
Federated search Call to Action Resources
4
Why Libraries? Users manage their files (content) in:
Known folders locations, such as My Documents, My Pictures, My Music, and My Videos Any other local or network folder Research shows that: Only 50% of user’s content is found in a known folder The other 50% of the content is not indexed
5
Libraries in Windows 7
6
Definition of Library “Libraries are destinations where users can find and organize their data as collections of items that may span multiple locations.”
7
Managing Libraries Windows Explorer has a user interface to manage libraries
8
Demo Windows Shell Managing Libraries
9
Common File Dialogs The new Common File Dialogs have built-in support for libraries By using the Common File Dialogs, you get the libraries experience out of the box plus additional taskbar functionality Don’t use Use these ×
10
Making Your Application Aware of Libraries
Demo Making Your Application Aware of Libraries
11
Libraries Under the Hood
Library information is kept in a file The format of the .library-ms file is a private data structure and subject to changes Use the Shell Library APIs to manage libraries You should use the file to: Delete, rename, or wait for change notification <libraryDescription> <isLibraryPinned>-1</isLibraryPinned> <iconReference>imageres.dll,-1002</iconReference> <folderType>{7d49d726-3c21-4f05-99aa-fdc2c }</folderType> …
12
Library APIs Every operation that is exposed by theShell UI (Windows Explorer) can be performed programmatically The Shell exposes several COM objects and helper functions to work with libraries: Create new library Open an existing library Add or remove folder from a library Get a folder list from a library Get and set library options Get and set the library icon
13
Using the API Create Library
Shell APIs are COM-based To use the Library objects, interfaces, and functions you should: #include <shobjidl.h> #include <objbase.h> // IID_PPV_ARGS macro To create a new Library: HRESULT SHCreateLibrary(REFIID riid,void **ppv ); With the macro: IShellLibrary *pIShellLib; SHCreateLibrary(IID_PPV_ARGS(&pIShellLib));
14
Shell Helper Functions
Description SHAddFolderPathToLibrary Adds a folder to a library SHCreateLibrary Creates an IShellLibrary object SHLoadLibraryFromItem Creates and loads an IShellLibrary object from a specified library definition file SHLoadLibraryFromKnownFolder Creates and loads an IShellLibrary object for a specified KNOWNFOLDERID SHLoadLibraryFromParsingName Creates and loads an IShellLibrary object for a specified path SHRemoveFolderPathFromLibrary Removes a folder from a library SHResolveFolderPathInLibrary Resolves the target location of a library folder that has been moved or renamed SHSaveLibraryInFolderPath Saves an IShellLibrary object to disk
15
The IShellLibrary Interface
Commit Commits library updates to an existing file SetOptions and GetOptions LIBRARYOPTIONFLAGS: LOF_DEFAULT, LOF_PINNEDTONAVPANE, LOF_MASK_ALL Currently the only option is the LOF_PINNEDTONAVPANE SetFolderType Set the folder template (such as Pictures or Music)
16
Create Libraries and Add Folders
IShellLibrary *pIShelLibrary; HRESULT hr = SHCreateLibrary(IID_PPV_ARGS(&pIShelLibrary)); if (SUCCEEDED(hr)) { IShellItem *pIShellItem; SHAddFolderPathToLibrary(pIShelLibrary, L"C:\\Users\\Public\\Documents"); hr = pIShelLibrary->SaveInKnownFolder(FOLDERID_Libraries, L"My New Library", LSF_MAKEUNIQUENAME, &pIShellItem); pIShellItem->Release(); pIShelLibrary->Release(); }
17
The ShellLibrary Class Windows API Pack
public sealed class ShellLibrary : ShellContainer, IList<FileSystemFolder> { public ShellLibrary(…); public static ShellLibrary Copy(…); public static ShellLibrary Load(…); public static IKnownFolder LibrariesKnownFolder { get; } public override string Name {get;} public IconReference IconResourceId {get; set;} public LibraryFolderType LibraryType {get; set;} public Guid LibraryTypeId {get; set;} public string DefaultSaveFolder {set; get;} public bool IsPinnedToNavigationPane {get; set;} public bool ShowManageLibraryUI(…); public void Add(…) public void Close(); … }
18
Create Libraries and Add Folders
using (ShellLibrary library = new ShellLibrary(name, true)) { library.Add(folderPath); }
19
Many Other Operations using (ShellLibrary lib = ShellLibrary.Load(
"Documents", false)) { lib.IsPinnedToNavigationPane = true; lib.DefaultSaveFolder }
20
Custom Library Manager
demo Custom Library Manager Managing Libraries
21
Stay in Sync with Libraries
Goal is to be notified about: Structure changes in a library Content changes in a library folder Listen for changes to .Library-ms files Listen for changes to any content or file change from any folder in the library
22
Staying in Sync with Windows 7 Libraries
demo Staying in Sync with Windows 7 Libraries
23
Libraries Summary Libraries are destinations where users can find and organize their data as collections of items that may span multiple locations IShellLibrary is a COM interface that exposes methods to manage libraries The ShellLibrary is a .NET Framework wrapper that exposes the same functionality
24
Federated Search The Best Internet and Intranet Search Experience on the Desktop
25
Federated Search Consistent Experience Across Providers for Files and Other Items
Document repository Enterprise data store Enterprise application
26
How Federated Search Works
Rich client experience Previews, metadata, and drag-and-drop Familiar Explorer paradigms Simple and lightweight integration No client code Works with any server platform Standards-based OpenSearch 1.1 RSS and ATOM Authentication Integrated or custom 1. Search connector (.osdx) is installed 2. Windows sends search terms as an HTTP request 3. The server returns RSS results
27
Federated Search Your search provider should:
Accept URL queries Example: Define rich items Return RSS results Windows 7 enables federated search through: XML search connector description Property mapping Example: BookAuthor System.Author Thumbnail and preview URLs Custom view descriptions 1. Search connector (.osdx) is installed 2. Windows sends search terms as an HTTP request 3. The server returns RSS results
28
Building an Open Search File
demo Federated Search Building an Open Search File
29
Summary Windows 7 has a cleaner and more elegant shell Explorer
Users can find and organize their documents, pictures, music, and other content in an easy and consistent way The shell has many extension points Use these extension abilities in your software Give the user the same rich experience
30
Call to Action Use Common File Dialogs
Make your applications library aware Integrate with Shell APIs Participate in federated search Fill out the evaluation form for this presentation
31
Windows Summit 2010 4/15/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.