PRS310: Extending Explorer: Metadata Handlers, Live Icons ...

PRS310: Extending Explorer: Metadata Handlers, Live Icons ...

Windows Vista: Extending Explorer By Providing Metadata, Rich Previews And Thumbnails For Your File Types Marc Miller PRS310 Development Lead Microsoft Corporation Agenda Extending Windows Vista Explorer Metadata Architecture Overview Exposing file properties with Metadata Handlers Extending the metadata schema Enabling Live Icons Creating Rich Previews

2 Why Extend Explorer? 3 Metadata Architecture Windows Explorer and 3rd Party Applications Property System Query System Indexer System Index 3rd Party Schemas

System Schemas Property Handlers Image Media Property Property Handlers Handlers 3rd Party Property Handlers File Formats File Formats

File Formats 4 Metadata Currency Property Names Canonical Names System.Author System.Photo.FNumber System.Music.Artist System.Groupname.Propertyname PROPERTYKEY struct PROPERTYKEY { GUID fmtid; DWORD propid; };

PKEY_Author, PKEY_FNumber, PKEY_Artist 5 Metadata Currency Property Values PROPVARIANT struct PROPVARIANT { VARTYPE vt; union { LPCWSTR pszVal; // VT_LPWSTR UINT uintVal; // VT_UI4 CALPWSTR calpwstr; // VT_VECTOR | VT_LPWSTR ... And more ...

}; }; Intrinsic (e.g. System.DateModified) Calculated (e.g. System.Kind) Handler 6 IPropertyStore Mapping PROPERTYKEYs to PROPVARIANT values IPropertyStore HRESULT GetCount([out] DWORD *cProps); HRESULT GetAt(DWORD iProp, [out] PROPERTYKEY *pkey);

Metadata Handler HRESULT GetValue(const PROPERTYKEY &key, [out] PROPVARIANT *pv); HRESULT SetValue(const PROPERTYKEY &key, const PROPVARIANT *pv); HRESULT Commit(); Enumerate Available Properties Retrieve Property Values Set Property Values 7 Consuming the Property System SHCreateItemFromName() API IShellItem

GetPropertyStore() Shell Item Object IPropertyStore Property System System Schemas 3rd Party Schemas Intrinsic & Calculated Properties Property Store IPropertyStore

Handler-provided Properties Property Handler 8 Property Store Data Flow IInitializeWithStream::Initialize Initialize with stream IPropertyStore::GetCount() IPropertyStore::GetAt(i) Enumerate Available Properties Explorer

IPropertyStore::GetValue() Property Property Handler System Retrieve Property Values IPropertyStore::SetValue() Set Property Values IPropertyStore::Commit() Commit Changes 9 IPropertyStore Guidelines Characteristics of a good implementation Round-Tripping p->SetValue(PKEY_Author, Marc Miller)

p->GetValue(PKEY_Author) Marc MillerMarc MillerMarc Miller Explorer Property System Property Handler Open Metadata p->SetValue(PKEY_Dog, p->GetValue(PKEY_Dog) Marc Miller )

Marc Miller 10 IPropertyStore Services Helpers available to IPropertyStore implementers Fallback IPropertyStore Property Cache (IPropertyStoreCache) Property Store Serialization Property Store Capabilities Safe Save 11 Without Safe Save

IPropertyStore IStream IStream::Read Stream-over-file Underlying File Property Handler IStream::Write Corrupted Sad Panda 12

With Safe Save IPropertyStore IStream IStream::Read Safe-Save Stream-over-file Underlying File IStream::Write Property Handler IStream::Commit

Temporary File 13 Providing Content 3 ways to provide content Property Handlers (IPropertyStore) File formats Metadata Some full-text content Property Handlers + IFilters (Full-text)

File formats Metadata Extensive full-text content, multi-lingual Protocol Handlers + Shell Folders Non-file system based stores Metadata Extensive full-text content, multi-lingual 14 Implementing

IPropertyStore 15 Property Descriptions

16 Property Description APIs SHGetPropertyDescription() API IPropertyDescription System Schemas

3rd Party Schemas Property Provider Layer GetType() GetCanonicalName() GetEditControl() GetUILabel() Etc 17

Property Description Lists ex: prop:System.DisplayName;System.Author;System.Si 18 ze;etc Custom Schemas Try to use system properties: Best behavior in heterogeneous sets; e.g., Author, Photographer, Chef Custom properties: ISVName.ApplicationName.PropertyNam e Create your own PROPERTYKEYs Install your own .propdesc file

Install using SHInstallSchema() API Register your prop: strings 19 Custom Schemas 20 Live Icons Large 256x256 Rich 32bpp bit depth. Live Screenshot of

actual contents. Visual Treatments Drop Shadows Type Overlays New & simpler API IInitializeWithStre am 21 Thumbnail Provider Flow IInitializeWithItem::Initialize Initialize with IShellItem

Host Thumbnail Vista Explorer IThumbnailProvider::GetThumbnail() Provider or 3rd Party AppGet thumbnail image 22 Thumbnail Provider Services Overlays Adornments Caching Smooth Scaling Preserves Aspect Ratio

Wont scale-up Automatically displays icon PKEY_Thumbnail 23 Thumbnail Provider 24 Providing Rich Preview Handlers Interactive Read-only contents view Text highlighting. Light-weight

Same code runs in: Vista Explorer, Outlook 12, Common File Dialog. Implement: IInitializeWithStrea m 25 Previewing Architecture IInitializeWithStream Initialize from stream IPreviewHandler::SetWindow

Pass in the window Host IPreviewHandler::SetRect Set the size of window Vista Explorer or Do preview Outlook 12 IPreviewHandler::DoPreview Resize when needed Preview

Handler IPreviewHandler:SetR ect IPreviewHandler::Unload Unload Process Boundary 26 Guidelines Previewing is read-only Minimal UI Support Base Functionality Light-weight with fast start-up time Security and Privacy

Support accelerators and context menu 27 Rich Previews 28 Explorer Extensibility Futures Command Bar Extensibility Per file-type Per type-hierarchy Custom Explorer Modules Custom Explorer Templates

Pluggable Query Providers Your feedback needed! 29 Call To Action Providing best experience for your file formats Determine which System schemas to use Introduce custom schemas if needed Build a property handler Define property lists, virtual folders Build a Live Icon provider (Beta2) Build a rich Previewer (Beta2) 30

Other Resources PDC Talks DAT307 Windows Vista: Exploiting New Capabilities for Search and Organization OFF320 Developing with Microsoft Office System Search Technology DAT322 MSN Search: Building Web and Desktop Search into Your Applications ILL02 Enhancing your Win32 Application for Windows Vista Presentation Track Lounge MSDN Forum: Data Access, Storage, Search and Organize in Windows Vista Windows Vista Shell 31

2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. 32

Recently Viewed Presentations

  • Research Methods in the Sciences - University of Nigeria, Nsukka

    Research Methods in the Sciences - University of Nigeria, Nsukka

    Research Methods in the Sciences. Prof. Anthony A. Attama Drug Delivery and Nanomedicines Research Group. Department of Pharmaceutics, University of Nigeria, Nsukka University of Nigeria Postgraduate Workshop, October 12-13, 2017
  • De-carbonisation of UK Passenger Rail Transport: Approaches and

    De-carbonisation of UK Passenger Rail Transport: Approaches and

    The Challenge. Transport energy usage overall has been rising. Increased CO2 emissions to atmosphere, increasing Global Warming. Rail has good efficiency due to low rolling resistance BUT still needs to play its part in reversing this trend
  • The Artist as Creator ncient Greece 1100-200 BC

    The Artist as Creator ncient Greece 1100-200 BC

    The Artist as Creator Ancient Greece 1100-200 BC
  • TCP - University of Delaware

    TCP - University of Delaware

    While this helps TCP avoid time-outs, it also makes this version of TCP far more aggressive for loss probability greater than about 1% (where time-outs become quite prevalent for non-limited transmit TCP) Limited Transmit ECN Sometimes the router will have...
  • CHEST TRAUMA Majid Pourfahraji ANATOMY TRAUMA   Trauma, or

    CHEST TRAUMA Majid Pourfahraji ANATOMY TRAUMA Trauma, or

    Trauma, or injury, is defined as cellular disruption caused by an exchange with environmentalenergy that is beyond the body's resilience.. Trauma remains the most common cause of death for all individuals between the ages of 1 and 44 years and...
  • Lesson 13 Introduction to Classes CS1 Lesson 13

    Lesson 13 Introduction to Classes CS1 Lesson 13

    Using Private Member Functions. A private member function can only be called by another member function. It is used for internal processing by the class, not for use outside of the class. If you wrote a class that had a...
  • Organization of Congress

    Organization of Congress

    Proposed by 2/3 vote of Congress ¾ of states must ratify Nonlegislative Powers of Congress (cont.) Impeachment: a formal accusation of misconduct in office Majority of H.O.R. Must vote to impeach Senate conducts the trial 2/3 votes is required to...
  • VDOE Mathematics Update - HCPS Blogs

    VDOE Mathematics Update - HCPS Blogs

    Task Analysis Guide - Lower-level Demands. Involve recall or memory of facts, rules, formulae, or definitions ... Show sample of new pacing/curriculum guides. ... Which definition do you like better? Characteristics of Rich Mathematical Tasks.