45

Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd. Session Code: CLI308

Embed Size (px)

Citation preview

Page 1: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308
Page 2: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Windows 7 TaskbarNew User Interface for Your Application

Tomislav BronzinMicrosoft Regional Director & MVPCITUS Ltd. http://www.citusgrupa.com Session Code: CLI308

Page 3: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

About Tomislav BronzinMicrosoft Regional Director & MVP

Software Architect – CITUS Ltd.Consultant and trainer on .NET architecture and development, http://www.citusgrupa.comMETRO Trainer for Windows 7 and Unified Communication

INETA Europe Vice President http://europe.ineta.org One of the leaders of Microsoft Community in Europe

Recent projects:Protect@Work, Competence Manager, Forest Management, Smarthome,

Speaker: TechEd Europe, DevDays , DevReach, WinDays, Sinergija, NT Konferenca, Vizija

Contact at [email protected]

Page 4: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Agenda

How the taskbar evaluated?Design considerations for the new TaskbarManaged wrappers around native APIs:

Windows API Code Pack.NET 4 use WPF

Best practices and UI guidelinesA word about compatibility

Page 5: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308
Page 6: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Some Metrics

The evolution was justified, but…More than 90% of sessions have fewer than 15 windowsMore than 70% of sessions have fewer than 10Non-default taskbar options are used by 0-10% of users

Page 7: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Design Goals For New Taskbar

Single launch surface for frequent programs and destinationsEasily controllableClean, noise-free, and simpleNew opportunities for extensibility

Page 8: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Taskbar Buttons

ConsolidationQuick launchNotification area iconDesktop shortcutRunning application windows

Running Not running

Multiple windows and

hoverActive

Page 9: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Taskbar ButtonsDesign considerations

Only users can pin applications to the taskbarThe icon’s hot-track color is the icon’s dominant colorTest icons with high DPITest with various themes and glass colors

Page 10: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

The New Taskbar…and beyond

demo

Page 11: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Windows API Code Pack for Microsoft .NET Framework

Managed class library to ease .NET Framework access to Windows 7:

Taskbar Jump Lists, Icon Overlay, Progress Bar, Tabbed Thumbnails, and Thumbnail Toolbars, Libraries, Known Folders, Sensor platform, etc

and some Windows 7 & Vista featuresUAC, power management, restart and recovery, network awareness, Aero Glass and more

Download it (with samples) from:http://code.msdn.microsoft.com/WindowsAPICodePack

Page 12: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Windows API Code Pack for Microsoft .NET Framework

Enables access to Windows 7 Taskbar APIs from managed codeContains the TaskbarManager class that wraps parts of the Windows Shell API

Static functions to manage Jump Lists, set Application ID, custom switching, thumbnail buttons, and more

Requirements:Windows 7 RTM + SDK for Win 7 RTM.NET Framework 3.5 SP1

Page 13: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

How Are Windows Grouped?Enter: Application ID

It’s a string, not a GUIDLimited to 128 charactersNaming convention – Company.Product.SubProduct.Version

All your application components have it:Process, shortcut, window, taskbar button, document type

Page 14: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Application IDHeuristics of determining the Application ID

Application ID

Shortcut

Jump List

Windows

Application ID can “fall back”to a larger scope if needed

Default computatio

n

Process

Document Type Registrations

Page 15: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Setting the Application ID

Process-wide – affects all windows in the current process:

Window ID – affects only ONE window:

TaskbarManager.Instance.ApplicationId = "MS.Taskbar.Concepts.1";

TaskbarManager winTaskbar = TaskbarManager.Instance;

winTaskbar.SetApplicationIdForSpecificWindow(winHandle, appID);

Page 16: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

(un)Grouping Windowsdemo

Page 17: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Jump List

It’s a mini Start menu

Page 18: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Jump ListsA detailed look

Destinations(“nouns”)

Tasks(“verbs”)

Known categories

Custom categories

User tasks

Taskbar tasks

Pinned category

Page 19: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

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!

You also expect the common tasks to be there

Page 20: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

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

Associate your program with the file extension

Use common file dialogs

Use explicit recent document API

RegisterFileAssociations( progId, registerInHKCU, appId, openWith, extensions );

CommonOpenFileDialog = ...; dialog.ShowDialog();

JumpList jumpList = JumpList.CreateJumpList();jumpList.AddToRecent(fileName);

Page 21: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

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.

Page 22: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Customizing the Jump ListStep 2: Adding tasks

JumpList jumpList;

jumpList.AddUserTasks(new JumpListLink(System.IO.Path.Combine(systemFolder, "notepad.exe"), "Open Notepad");

jumpList.AddUserTasks(new JumpListSeparator());

jumpList.Refresh();

Page 23: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Tasks and destinations…in a Jump List

demo

Page 24: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

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 association

Page 25: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Customizing the Jump ListStep 3: Adding categories

category1 = new JumpListCustomCategory("Custom Category 1"); //JumpList.AddCustomCategories(category1);

category1.AddJumpListItems(new JumpListItem(path));

jumpList.Refresh();

Page 26: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Addin Custom Categories…in a Jump List

demo

Page 27: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Thumbnail Toolbars

Remote control from the taskbar

Page 28: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Thumbnail ToolbarsDesign considerations

You get up to seven buttonsCan’t add or delete; can hide and disable

Tasks are not thumbnail buttons!

Tasks Thumbnail ButtonsEntry point Menu or toolbarApplication-wide Window-specificCan act dynamically Must be static

Page 29: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Creating Thumbnail Toolbarsprivate ThumbnailToolbarButton buttonFirst;

buttonFirst = new ThumbnailToolbarButton(TaskbarConcepts.Resources.first, "First Image");

buttonFirst.Enabled = false;buttonFirst.Click += buttonFirst_Click;

private void buttonFirst_Click(object sender, EventArgs e) { ShowList(0);}

Page 30: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Get More From Taskbar ButtonsOverlay and progress icons

Consolidate: Uncluttered notification areaProvide progress and additional information through the taskbar button

It’s free if you use standard progress dialogs

Page 31: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Taskbar Overlay and ProgressDesign considerations

Notification area is now user controlled:Leave yourself out if possible!

Use taskbar buttons for custom progress or status information

Page 32: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Taskbar Overlay and ProgressThe APIs

TaskbarManager winTaskbar = TaskbarManager.Instance;

// IconwinTaskbar.SetOverlayIcon(icon, "icon1");

// Set normal progressbarwinTaskbar.SetProgressValue((int)progressSlider.Value, 100);winTaskbar.SetProgressState(TaskbarProgressBarState.Normal);

. . .// Remove progressbarwinTaskbar.SetProgressState(TaskbarProgressBarState.NoProgress);

Page 33: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Overlay & Progress Icons…in Taskbar Button

demo

Page 34: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Live Thumbnails

Live thumbnails: A livepreviewWindows Vista®: One thumbnail per windowWindows 7: Grouped thumbnails

Page 35: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Peek Preview (Aero Peek)

Live peek without a click

Page 36: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Live Thumbnails and PeekDesign considerations

Desktop Window Manager (DWM) only talks to top-level windows

Child windows need a custom representationThe thumbnail might be “too much” or “not enough”

What if you could …Test your thumbnails to make sure they are usefulIf they aren’t, customize them!

Page 37: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Thumbnail Clip (Zoom)

Zoom into the important parts!

Page 38: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Customizing Live Thumbnails

TabbedThumbnail preview = new TabbedThumbnail(Application.Current.MainWindow, image, offset); TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(preview);TaskbarManager.Instance.TabbedThumbnail.SetActiveTab(preview);

Customizing Peek PreviewTabbedThumbnail preview = TaskbarManager.Instance.TabbedThumbnail.GetThumbnailPreview(image);if (preview != null) preview.InvalidatePreview();

Page 39: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

SummaryQuick launch is deprecatedNotification area should be kept cleanProper file associations are crucial for most-recently used or most-frequently used and custom categoriesUsers will expect destinations and tasksShould child windows have thumbnails?Bad/Good examples:

Bad: Microsoft VS 2008, Office Outlook® 2007Good: Office Outlook 2010

Page 40: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

question & answer

Page 41: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

www.microsoft.com/teched

Sessions On-Demand & Community

http://microsoft.com/technet

Resources for IT Professionals

http://microsoft.com/msdn

Resources for Developers

www.microsoft.com/learning

Microsoft Certification & Training Resources

Resources

Page 42: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Related Content

DEV309 The Windows API Code Pack: How Managed Code Developers Can Easily Access Exciting New Windows Vista and Windows 7 Features

CLI09-IS For Developers: Common Application Compatibility Issues between Windows XP, Windows Vista, and Windows 7

WCL08-HOL Windows 7: Mitigating Application Issues Using Shims

WCL05-HOL Windows 7: Application Compatibility Toolkit 5.5

Page 43: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

Complete an evaluation on CommNet and enter to win an Xbox 360 Elite!

Page 44: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308
Page 45: Tomislav Bronzin Microsoft Regional Director & MVP CITUS Ltd.   Session Code: CLI308

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