37
Lynn Langit – blogs.msdn.com/SoCalDevGal Senior Developer Evangelist Microsoft Corporation Optimizing Your Application for the Windows 7 User Experience SESSION CODE: WCL312

Windows 7 Developer APIs

Embed Size (px)

DESCRIPTION

deck from TechEd Africa 2010 (Durban)

Citation preview

Page 1: 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

Page 2: Windows 7 Developer APIs

2

Amazing User Experience

DEMOWinXP to Windows 7 Photo Viewer

Page 3: Windows 7 Developer APIs

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

Page 4: Windows 7 Developer APIs

4

Libraries

Sensor APIs

Parallelism

Multi-touch

DirectX 11 Family

Ribbon

Developing for Windows 7Taskbar

Complexity

Page 5: Windows 7 Developer APIs

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

Page 6: Windows 7 Developer APIs

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

Page 7: Windows 7 Developer APIs

7

Windows 7 Libraries

Page 8: Windows 7 Developer APIs

8

Staying In-Sync with Windows 7 Libraries

DEMO

Page 9: Windows 7 Developer APIs

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> …

Page 10: Windows 7 Developer APIs

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:\";}

Page 11: Windows 7 Developer APIs

11

Working with the Windows 7 Library API

DEMO

Page 12: Windows 7 Developer APIs

12

Federated SearchConsistent experience across providers; files and otherwise

Document repository

Enterprise data store

Enterprise application

Page 13: Windows 7 Developer APIs

13

Windows 7 Federated Search

Demo

Page 14: Windows 7 Developer APIs

14

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

Help ButtonContextual TabContextual Tab GroupTabQuick Access

Toolbar

Application Menu

Group

Page 15: Windows 7 Developer APIs

15

Windows Ribbon

Demo

Page 16: Windows 7 Developer APIs

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>

Page 17: Windows 7 Developer APIs

17

Building Your Own Ribbon

DEMO

Page 18: Windows 7 Developer APIs

18

Windows Taskbar

Page 19: Windows 7 Developer APIs

19

Taskbar Buttons

ConsolidationQuick launchNotification area iconDesktop shortcutRunning application windows

Running Not runningMultiple windows

and hoverActive

Page 20: Windows 7 Developer APIs

20

Taskbar Overlay IconsThe APIs

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

Hands on Lab – video - here

Page 21: Windows 7 Developer APIs

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();

Page 22: Windows 7 Developer APIs

22

Windows Taskbar

DEMOOverlay icons and progress bar

Page 23: Windows 7 Developer APIs

23

Live Thumbnails

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

Page 24: Windows 7 Developer APIs

24

Thumbnail Clip (Zoom)

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

Video - here

Page 25: Windows 7 Developer APIs

25

Jump ListsA detailed look

Destinations(“nouns”)

Tasks(“verbs”)

Known categories

Custom categories

User tasks

Taskbar tasks

Pinned category

Page 26: Windows 7 Developer APIs

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

Page 27: Windows 7 Developer APIs

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");

Page 28: Windows 7 Developer APIs

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);

Page 29: Windows 7 Developer APIs

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);

Page 30: Windows 7 Developer APIs

30

Built for Windows 7 – Travel Package Creator

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

Page 31: Windows 7 Developer APIs

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

Page 32: Windows 7 Developer APIs

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

Page 33: Windows 7 Developer APIs

33

Get the Book!

Page 34: Windows 7 Developer APIs

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

Page 35: Windows 7 Developer APIs

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

Page 36: Windows 7 Developer APIs

36

TeachingKidsProgramming.org

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

Page 37: Windows 7 Developer APIs

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