windows 7 – a developer’s guide to building killer windows 7 applications bijoy singhal │...
DESCRIPTION
Windows 7 Developer OverView Lots of new features for development Aero, Taskbar & Desktop Libraries Sensors Multi-Touch DirectX including DirectWrite and Direct2D App Restart & Recovery And much, much more…TRANSCRIPT
![Page 1: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/1.jpg)
Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications
Bijoy Singhal │ Developer Evangelist, Microsoft India
![Page 2: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/2.jpg)
AgendaWindows 7 Developer OverviewIntroducing the Windows API Code PackA Lap around Windows 7 “goodness”Easy ways to “light up” your application
Taskbar buttonsThumbnail toolbarsOverlays and ProgressCustom ThumbnailsJumpLists
Other Light Up scenarios
![Page 3: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/3.jpg)
Windows 7 Developer OverViewLots of new features for development
Aero, Taskbar & Desktop LibrariesSensorsMulti-TouchDirectX including DirectWrite and Direct2DApp Restart & RecoveryAnd much, much more…
![Page 4: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/4.jpg)
The Windows API Code Pack for .NET
• Windows Platform SDK – for native code• Windows API Code Pack – for managed code– Gives access to most of the features in Win7– Full source code available– Current version: 1.1– All features degrade gracefully on older Windows– Tons of samples in the package– Get it @ http://code.msdn.microsoft.com/WindowsAPICodePack
![Page 5: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/5.jpg)
Windows API Code Pack Structure• Consists of a number of projects for different items– Core: Consists of core services like network, power, app
recovery service, property system etc.– Shell: Works with the UI – aero, taskbar, controls,
common dialogs and more…– DirectX: allows .NET apps to use D2D, D3D & DW– Sensors: to use light, motion and position
• Lighting up apps is very easy with Core & Shell
![Page 6: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/6.jpg)
Windows 7 UI Design Goals
• Clean, noise-free & simple• Single launch surface for most used apps and
files• Get to information faster without needing to
“switch” to application• User has control on apps, desktop, icons
![Page 7: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/7.jpg)
“Light Up” Features for Free!
• Apps running on Win7 get some light up features for free– Aero Peek– Aero Snap– Aero Shake– Taskbar Fixed Positioning– Mouse Hot Tracking Free
!
![Page 8: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/8.jpg)
DemoAero PeekAero SnapAero ShakeTaskbar PositioningMouse Hot Tracking Free
!
![Page 9: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/9.jpg)
Light Up Feature I: Aero Glass
• Add Aero Glass forms to your app• Detect availability of Aero• Option to turn off Aero as well
• WACP Code public partial class Form1 : GlassForm
![Page 10: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/10.jpg)
DemoMaking a WinForm Glassy
![Page 11: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/11.jpg)
Light Up Feature II: Application ID• Configures application taskbar button grouping• Default is program name• Scenarios to customize– Single app, multiple icon– Multiple apps, single icon
• WACP CodeTaskbarManager Taskbar = TaskbarManager.Instance;Taskbar.ApplicationId = “MyAppName”;
![Page 12: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/12.jpg)
DemoApplication ID TaskBar Button Grouping
![Page 13: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/13.jpg)
Light Up Feature III: Overlay Icons
• Add icon overlay to application icon• Use to display “state” of application• Makes icon the place to view
• WACP Code
TaskbarManager Taskbar = TaskbarManager.Instance;Taskbar.SetOverlayIcon(SystemIcons.Asterisk, “My Status");
![Page 14: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/14.jpg)
DemoOverlay Icons
![Page 15: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/15.jpg)
Light Up Feature IV: Taskbar Progress
• Show progress bars in application icon• Multiple progress states to show running
status• Can only show one progress bar at a time
• WACP Code
TaskbarManager Taskbar = TaskbarManager.Instance;Taskbar.SetProgressState(TaskbarProgressBarState.Normal);Taskbar.SetProgressValue(CurrentValue, MaximumValue);
![Page 16: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/16.jpg)
DemoTaskbar Progress
![Page 17: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/17.jpg)
Light Up Feature V: Thumbnail Toolbars
• Allow interacting with application from thumbnail
• Add up to 7 buttons in thumbnail• Cannot remove buttons, but can hide
• WACP Code
ThumbnailToolbarButton btn = new ThumbnailToolbarButton(Icon, “Tooltip”);
btn.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(btn_Click);
Taskbar.ThumbnailToolbars.AddButtons(this.Handle, btn);
![Page 18: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/18.jpg)
DemoThumbnail Toolbars
![Page 19: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/19.jpg)
Light Up Feature VI: Thumbnails Clipping
• Sometimes the default thumbnail is not good enough
• Display the most important part of the window
• Can reset back to full window
• WACP Code
Taskbar.TabbedThumbnail.SetThumbnailClip(WindowHandle, Rectangle);
![Page 20: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/20.jpg)
DemoThumbnail Customizing with Clipping
![Page 21: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/21.jpg)
Light Up Feature VII: Jump Lists• Mini Start menu for each application• Consists of:– Categories– Tasks– Destinations– Recent, Frequent & Pinned items
• Registered extensions are automatically handled• WACP Code – next slide
![Page 22: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/22.jpg)
Jump Lists WACP Code// Declare and instantiateJumpList jl;jl = JumpList.CreateJumpList();// Show from Recent, Frequent or None. (Pinned is auto)jl.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent;// Add taskjl.AddUserTasks(new JumpListLink(Path), “My Task"){Icon}jl.AddUserTasks(new JumpListSeparator());// Add categoryJumpListCustomCategory c1 = new JumpListCustomCategory("Documents");jl.AddCustomCategories(c1);// Add Destinationc1.AddJumpListItems(new JumpListItem(PathToFile));// Refreshjl.Refresh();
![Page 23: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/23.jpg)
DemoJump ListsTasksCategoriesDestinationsKnown Types Recent Frequent Pinned
![Page 24: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/24.jpg)
Light Up Feature VIII: Sensors
• Many different types of sensors in Windows 7– Light– Accelerometer– Location
• WACP Code (sample)
SensorList<SensorType> sl = SensorManager.GetSensorsByTypeId<SensorType>( );
SensorManager.SensorsChanged += new SensorsChangedEventHandler(S_Changed);
![Page 25: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/25.jpg)
DemoWorking with Sensors
WACP Sample – AccelerometerWACP Sample - AmbientLight
![Page 26: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/26.jpg)
Summary• Windows 7 is a developer’s delight• Tons of new stuff that you can add to your apps• The Windows API Code Pack lets you get these
features in .NET apps very easily• The easiest way to get your app to light up on
Windows 7 is to use the Taskbar and UI features
![Page 28: Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India](https://reader035.vdocuments.us/reader035/viewer/2022062219/5a4d1b107f8b9ab05998e7ca/html5/thumbnails/28.jpg)
© 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.