Windows 7 Developer APIs

Post on 31-Aug-2014

3.057 views 1 download

Tags:

description

deck from TechEd Africa 2010 (Durban)

Transcript of Windows 7 Developer APIs

Lynn Langit – blogs.msdn.com/SoCalDevGalSenior Developer EvangelistMicrosoft Corporation

Optimizing Your Application for the Windows 7 User Experience

SESSION CODE: WCL312

2

Amazing User Experience

DEMOWinXP to Windows 7 Photo Viewer

3

Create new experiences on Windows 7

Building A Great Windows 7 ApplicationsEX

PERI

ENCE Differentiate

Optimize

Compatible

Become a first class Windows 7 citizen

Product passes Microsoft quality tests

4

Libraries

Sensor APIs

Parallelism

Multi-touch

DirectX 11 Family

Ribbon

Developing for Windows 7Taskbar

Complexity

5

Optimize For User Experience- AgendaMake sure your application looks and feels like Windows 7 first class citizen

Windows 7 Libraries Become library aware and work with libraries Federated Search

Windows RibbonWindows 7 Taskbar

Jump ListsAero Peek

6

Windows API Code Pack

Set of libraries to expose Windows 7 features to .NET DevelopersIf you prefer to code in C++, not neededFound at http://code.msdn.microsoft.com/WindowsAPICodePack

7

Windows 7 Libraries

8

Staying In-Sync with Windows 7 Libraries

DEMO

9

Libraries Under The Hood

Library information is kept in a file (.library-ms)The format of the .library-ms file is a private data structure and subject to changesUse ONLY the Windows Shell Library APIs to manage and interact with libraries

Use the library file definition to: Delete, rename, or wait for change notification (changes to the library structure)

<libraryDescription> <name>@shell32.dll,-34575</name> <isLibraryPinned>-1</isLibraryPinned> <iconReference>imageres.dll,-1002</iconReference> <folderType>{7d49d726-3c21-4f05-99aa-fdc2c9474656}</folderType> …

10

Create Library / Add Folder Using Windows API Code Pack//Create new library and add a folderusing (ShellLibrary library = new ShellLibrary(name, true)){ library.Add(folderPath);}

//Load the document library, add new folder, pin to nav panusing (ShellLibrary lib = ShellLibrary.Load( "Documents", false)){ lib.Add(@"C:\"); lib.IsPinnedToNavigationPane = true; lib.DefaultSaveFolder = @"C:\";}

11

Working with the Windows 7 Library API

DEMO

12

Federated SearchConsistent experience across providers; files and otherwise

Document repository

Enterprise data store

Enterprise application

13

Windows 7 Federated Search

Demo

14

Windows RibbonIn-box with Windows 7Feature parity with Office 2007 RibbonResult-oriented UI

Help ButtonContextual TabContextual Tab GroupTabQuick Access

Toolbar

Application Menu

Group

15

Windows Ribbon

Demo

16

Windows Ribbon UI ArchitectureRibbon elements are specified in markupAvailable controls

Menus, drop-down galleries, combo boxes, font control, buttons, spinners, tabs and groups and more

Markup: Organization of controls

Application-Specific Business Logic

Windows Ribbon

COM API: Initialization and events handling

void DoStuff() { … … }

MyHandler::Execute(…){ DoStuff();}

<Ribbon> <Tab> <Button … /> </Tab></Ribbon>

17

Building Your Own Ribbon

DEMO

18

Windows Taskbar

19

Taskbar Buttons

ConsolidationQuick launchNotification area iconDesktop shortcutRunning application windows

Running Not runningMultiple windows

and hoverActive

20

Taskbar Overlay IconsThe APIs

//WPF: TaskbarManager.SetOverlayIcon (System.Windows.Window window, System.Drawing.Icon icon, string accessibilityText)

Hands on Lab – video - here

21

Taskbar Overlay and ProgressNotification area is now user controlled:

Leave yourself out if possibleUse taskbar buttons for custom progress or status information

FREE if you use standard progress dialogs

myForm.SetTaskbarOverlayIcon(icon, "...");ProgressBar pb = ...;pb.SetTaskbarProgress();

22

Windows Taskbar

DEMOOverlay icons and progress bar

23

Live Thumbnails

Live thumbnails: A live previewWindows 7: Grouped thumbnailsNo click – just hover

24

Thumbnail Clip (Zoom)

TabbedThumbnailManager ttm = new ...;ttm.AddThumbnailPreview(TabbedThumbnail preview)

Video - here

25

Jump ListsA detailed look

Destinations(“nouns”)

Tasks(“verbs”)

Known categories

Custom categories

User tasks

Taskbar tasks

Pinned category

26

Jump ListsDesign considerations

Surface key destinations and tasksRecent and frequent are freePinned is also free (if users use it)Respect items the user removes!

Addictive: You don’t look for documents anywhere else!Users expect common tasks to be there

27

Customizing the Jump ListStep 1: Get the free stuff to work

Associate your program with the file extensionUse common file dialogsUse explicit recent document API

RH.RegisterFileAssociations(...);OpenFileDialog ofd = ...; ofd.ShowDialog();JumpList jl = ...;jl.AddToRecent("file.ext");

28

Customizing the Jump ListStep 2: Adding tasks

What would your user like to do?Launch your application with special arguments?Launch other applications?

Tasks are IShellLink objectsRich shortcut semantics including arguments, working directory, icon, and so on.

JumpList jl = ...;jl.AddUserTasks(params IJumpListTask[] tasks);

29

Customizing the Jump ListStep 3: Do you have categories?

Does it make sense to categorize documents?Is frequent, recent, pinned not enough?For example, Inbox, Outbox, Sales, Marketing …

Categories contain IShellItem or IShellLink objects

These are documents: You need a file associationHOL Video - here

JumpList jl = ...;jlm.AddCustomDestination(params JumpListCustomCategory[] customCategories);

30

Built for Windows 7 – Travel Package Creator

DEMO• Jumplist• Taskbar• Multi touch• And more!

31

Optimize for PerformanceGet the Most Out of Windows Performance Enhancements

Application restart and recovery with Restart ManagerI/O priorities and cancelable I/OFile System and Registry Transaction SupportEvent Tracing for Windows (ETW) – high-performance instrumentationWindows Error ReportingTrigger-Start ServicesWindows Troubleshooting PlatformPower efficiency improvements

WLC306 - Fundamentals in Windows Applications for Developers: Graphics, Power, Services, and Profiling

See recording

32

Related ContentBreakout Sessions

WCL206 – My Favorite WPF4 FeaturesWCL305 – Optimizing Your Application for the Windows 7 ExperienceWCL410 - Windows 7 and IE8 Application Compatibility Remediation

Other content by Lynn LangitBlog series – Windows 7 Multi Touch Programming - HerePresentation – Developing Windows 7 Applications with VS2010 - HereFacebook Group – Windows 7 Developers

33

Get the Book!

34

Resources

www.microsoft.com/teched

Sessions On-Demand & Community Microsoft Certification & Training Resources

Resources for IT Professionals Resources for Developers

www.microsoft.com/learning

http://microsoft.com/technet http://microsoft.com/msdn

Learning

Complete an evaluation via CommNet and Tag to win amazing prizes!

36

TeachingKidsProgramming.org

• Do a Recipe Teach a Kid• Free Courseware (recipes)• Ages 10 ++• Microsoft SmallBasic

© 2008 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.