Windows 7 For Developers

Post on 28-Jan-2015

1780 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

This presentation provides some outline for developers to build cool applications by utilyzing some great features available in windows 7.

Transcript

Windows 7 for Developers

Mohammad Ashraful AlamMicrosoft MVP 2007 - 2009[ www.ashraful.net ]

Agenda

Agenda

• Introduction• Taskbar• Windows Ribbon• Multitouch• Sensors and Location• More..• Resources and References

Common System Requirements• Windows 7• Visual Studio 2008 SP1/ Visual Studio 2010 Beta 2

(or higher)• Windows 7 SDK• Windows API Code Pack for the .NET Framework• Windows 7 Multitouch .NET Interop Sample Library

Windows7 API CodePack for .NET• .NET Wrapper for Windows 7® features– Taskbar, – Libraries– Sensor– Location–Multi-Touch– UAC– power management– restart and recovery– network awareness, Aero Glass and more.

Taskbar

Windows 7 Taskbar

• Taskbar Buttons• Jump Lists • Thumbnail Preview• Thumbnail Toolbars • Custom Switchers• Icons• Overlay Icons• Progress Bars

Taskbar Buttons

– Quick launch– User friendly– Running application windows

RunningNot running

Multiple windows

Active

Destinations(“nouns”)

Tasks(“verbs”)

Known categories

Custom categories

User Tasks

Taskbar Tasks

Pinned category

Jump Lists

Thumbnail Preview

Thumbnail Toolbars

Taskbar Overlay

Surface important notificationsAppears over your taskbar button

Taskbar Overlay IconsCode Snippets

WinForms: TaskbarManager.SetOverlayIcon(IntPtrwindowHandle, System.Drawing.Icon icon, string accessibilityText)

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

Taskbar Progress bar

Shows progress statusAppears over your taskbar button

Taskbar Progress BarCode Snippets

WinForms: TaskbarManager.SetProgressState(TaskbarProgressBarState state, IntPtrwindowHandle)

WPF: TaskbarManager.SetProgressState(TaskbarProgressBarState state, System.Windows.Window window)

Windows Ribbon

Application Menu

Quick Access Toolbar

Tab Contextual Tab Set

Contextual Tab

Help

Group (aka “Chunk”)

Dialog Launcher

• In-box with Windows 7, redistribution available to Vista

• Win32 API, • Feature parity (or close) with Microsoft Office

2007 Ribbon, and WPF Ribbon

Windows Ribbon

Categorized Menus

Tabs & Groups

Color Pickers

Mini Toolbar &Contextual Menu

Dropdown GalleriesTooltips

Check Boxes

Spinners

Font Control

Group Dialog Launchers

“In-Ribbon” Galleries

Combo Boxes

Buttons & Split Buttons

Windows Ribbon - Controls

Windows Ribbon API Interfaces• Consists of these main interfaces

IUIFramework – initialize ribbon, load markup resource, get or set command property values or state, set application modes

IUIApplication– user-implemented interface. Retrieves user command handler for each command defined in the markup. Notifies about view state changes

IUICommandHandler – user-implemented interface. Handles commands, updates property value (for example, setting a command to enabled or disabled based on view)

Integrating Windows Ribbon

ApplicationRibbon Platform

IUIApplication

IUIFramework

CoCreateInstance

Initialize (HWND, IUIApplication*)

LoadUI( resourceName )

OnCreateCommand

IUICommandHandler

Execute, UpdateProperty

Get/SetUICommandProperty, InvalidateUICommand

Multitouch

Multi-Touch Is Here!

• Hardware–Multi-touch enabled hardware device

• Software–Windows 7, .NET Framework 4.0

• Consumers– New scenarios, next wave of user – experience, high “WOW” factor

We’ve identified several key scenarios for multi-touch:• Navigating and consuming the

web• Reading & sorting email• Viewing photos• Playing casual games• Consuming music and video• Navigating files & arranging

windows• Using Office applications

Multi-Touch Is Scenarios

Multi-Touch Development TiersGood – Better – Best• Windows application can target one of

three levels of touch integrationGood: No specific touch APIs are used but the application UI is appropriately sized and works well with the built-in gestures

Better: The gesture APIs are supported to give smooth natural interactions

Best: Deep touch-focused experiences designed to take advantage of multi-touch features

Good

APIsFor Free!

Panning/zoom gesturesRight-click gesture

Native Win32

Controls with standard scrollbars

WPF

WPF 3.5 SP1 API CodePack

WPF 4.0 full support + Controls

WinForms

Controls with standard scrollbars

Best

Raw touch dataManipulation and inertia processors

WM_TOUCHCOM-based

manipulation and inertia processors

Touch eventsManipulation and inertia processors

Manipulation and inertia processors via COM interoperability

Better

Gesture notificationsPan/zoom/rotate

and so on

WM_GESTURE message

Gesture eventsInertia configuration

WM_GESTURE message via

interoperability

Call To Action

• Decide the appropriate scenario that fits with concept of multi-touch feature

• Decide which tier of investment is appropriate

• Check your current applications• Add– Gesture– Or manipulation– Or inertia

• Build something amazing!

Sensors and Location

Few Real World Usage• In a sunny day, an

application might increase brightness, contrast etc

• An application might provide location-specific information, such as nearby restaurants

• An application might use a human presence sensor to change the state of the Messenger status

Sensor Platform Overview• Windows 7 features a new API for

working with sensors– COM-based API–Works with drivers using the sensor

class extension• You can seamlessly interact with any

type of sensor, such as– Ambient light sensor– Temperature gauge– GPS device etc

Location Platform Overview

• The Location API lets you obtain the location without caring about the particular mechanism used to obtain the information, for example, – GPS– cell-tower or –Wi-Fi hotspot triangulation.

• The Location API automatically chooses the most accurate sensor data available.

Sensor and Location API: Benefits– Hardware-independence: No need to

target vendor-specific APIs or to know hardware specifics

– Application sharing: Multiple applications can consume data from the same sensor simultaneously

Privacy

• Privacy: Because Microsoft recognizes that sensor and location data are private, personally identifying information, all sensors are disabled by default.

Sensor and Location Platform Architecture – The Big Picture

UMDF sensor driver

Sensor class extension

Sensor API

Gadget or script Application

Location and Other Sensors Control Panel

Sensordevice

Location APILocation IDispatch Interface

Application

UMDF sensor driver

Sensor class extension

Logical location sensor(Triangulation)

User

System

Sensor Wrapper Architecture

• Sensor is an abstract base class with a derived type for each sensor type– Derived types can add properties and

events

Receiving Data Reports from Sensora3dSensor.DataUpdated += OnDataUpdated;

void OnDataUpdated(Sensor sensor, SensorDataReportdataReport){ Accelerometer3DReport a3dReport=(Accelerometer3DReport)dataReport;Console.WriteLine("X: {0} Y: {1} Z: {2}", a3dReport.AxisX_G, a3dReport.AxisY_G, a3dReport.AxisZ_G); }

More ..

More ..

• High DPI• Version Checking• Instrumentation and Performance• Background Services• Shell Libraries

Reference and Resources

• Training Materials– Channel 9 Windows 7 Online Training: http://3.ly/Win7Tr

– Windows 7 Training Kit For Developers: http://3.ly/Win7TK

• Software Materials– Microsoft Windows SDK for Windows 7 and .NET Framework

3.5 SP1: http://3.ly/win7SDK – Windows® API Code Pack for Microsoft® .NET Framework:

http://3.ly/Win7CP– Windows 7 Multitouch .NET Interop Sample Library:

http://3.ly/Win7Touch

Contact

• Mohammad Ashraful Alam–Web: www.ashraful.net– Blog: http://blog.ashraful.net– Email: admin [a-t] ashraful.net– Twitter: http://twitter.com/AshrafulAlam

Thank You!

top related