Top Banner
Windows 7 for Developers Mohammad Ashraful Alam Microsoft MVP 2007 - 2009 [ www.ashraful.net ]
40

Windows 7 For Developers

Jan 28, 2015

Download

Technology

joycsc

This presentation provides some outline for developers to build cool applications by utilyzing some great features available in windows 7.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Windows 7 For Developers

Windows 7 for Developers

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

Page 2: Windows 7 For Developers

Agenda

Page 3: Windows 7 For Developers

Agenda

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

Page 4: Windows 7 For Developers

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

Page 5: Windows 7 For Developers

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.

Page 6: Windows 7 For Developers

Taskbar

Page 7: Windows 7 For Developers

Windows 7 Taskbar

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

Page 8: Windows 7 For Developers

Taskbar Buttons

– Quick launch– User friendly– Running application windows

RunningNot running

Multiple windows

Active

Page 9: Windows 7 For Developers

Destinations(“nouns”)

Tasks(“verbs”)

Known categories

Custom categories

User Tasks

Taskbar Tasks

Pinned category

Jump Lists

Page 10: Windows 7 For Developers

Thumbnail Preview

Page 11: Windows 7 For Developers

Thumbnail Toolbars

Page 12: Windows 7 For Developers

Taskbar Overlay

Surface important notificationsAppears over your taskbar button

Page 13: Windows 7 For Developers

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)

Page 14: Windows 7 For Developers

Taskbar Progress bar

Shows progress statusAppears over your taskbar button

Page 15: Windows 7 For Developers

Taskbar Progress BarCode Snippets

WinForms: TaskbarManager.SetProgressState(TaskbarProgressBarState state, IntPtrwindowHandle)

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

Page 16: Windows 7 For Developers

Windows Ribbon

Page 17: Windows 7 For Developers

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

Page 18: Windows 7 For Developers

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

Page 19: Windows 7 For Developers

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)

Page 20: Windows 7 For Developers

Integrating Windows Ribbon

ApplicationRibbon Platform

IUIApplication

IUIFramework

CoCreateInstance

Initialize (HWND, IUIApplication*)

LoadUI( resourceName )

OnCreateCommand

IUICommandHandler

Execute, UpdateProperty

Get/SetUICommandProperty, InvalidateUICommand

Page 21: Windows 7 For Developers

Multitouch

Page 22: Windows 7 For Developers

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

Page 23: Windows 7 For Developers

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

Page 24: Windows 7 For Developers

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

Page 25: Windows 7 For Developers

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

Page 26: Windows 7 For Developers

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!

Page 27: Windows 7 For Developers

Sensors and Location

Page 28: Windows 7 For Developers

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

Page 29: Windows 7 For Developers

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

Page 30: Windows 7 For Developers

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.

Page 31: Windows 7 For Developers

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

Page 32: Windows 7 For Developers

Privacy

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

Page 33: Windows 7 For Developers

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

Page 34: Windows 7 For Developers

Sensor Wrapper Architecture

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

events

Page 35: Windows 7 For Developers

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

Page 36: Windows 7 For Developers

More ..

Page 37: Windows 7 For Developers

More ..

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

Page 38: Windows 7 For Developers

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

Page 39: Windows 7 For Developers

Contact

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

Page 40: Windows 7 For Developers

Thank You!