The Windows API Code Pack Kate Gregory kate@gregcons.com www.gregcons.com/kateblog Session Code: DEV309
Windows 7 Builds on Windows Vista Few Changes: Most software that runs on Windows Vista® will run on Windows® 7 – exceptions will be low-level code (AV, Firewall, Imaging, etc.). Hardware that runs Windows Vista well will run Windows 7 well. Few Changes: Focus on quality and reliability improvements Deep Changes: New models for security, drivers, deployment, and networking
Improved Fundamentals Decrease Increase Memory Reference set, Graphics Disk I/O Registry Reads, Indexer Power DVD Playback, Panel, Timers Speed Faster Boot, Device Ready Responsiveness Start menu, Taskbar Scale 256 cores
Building A Great Windows 7 Application Differentiate Multitouch Windows Ribbon Sensors Optimize Windows Taskbar Libraries Fundamentals Get Compatible Version Checking User Account Control Removed Components
What is Code Pack? Managed class library to access to Win 7 features Windows Shell namespace Windows Vista and Windows 7 Task Dialogs. Support for Shell property system Taskbar Jumplists, Icon Overlay and Progress bar Common file dialogs Direct3D 11.0 and DXGI 1.0/1.1 APIs Sensor Platform APIs Extended Linguistic Services APIs http://code.msdn.com/windowsAPICodePack
A few highlights from Code Pack All today’s demos are from the samples that ship with it All are shipped in both VB and C# Samples are designed as a source of code for you But you would hardcode so much more Run the apps to experiment and see what you like
I’m going to show you Taskbar Jumplists Taskbar Overlays Taskbar Thumbnail Buttons Restart and Recovery Power Management
The New Windows 7 Taskbar Evolution of launch surfaces Clean, sleek, elegant design Enhances user productivity, making switching between windows much easier What users do most they can reach quickest Information is always present
Windows 7 Taskbar – Jump Lists Mini Start Menu for your program Access to key destinations and tasks Customizable
Windows 7 Taskbar – Jump Lists Pinned category Destinations (“nouns”) Known categories Custom categories User Tasks Tasks (“verbs”) Taskbar Tasks
demo Taskbar - Jumplists
Windows 7 Taskbar – Icons Face of your program Large and small icons Only customer can pin Color hot-track Icon Overlay Best place for notifications Appears over your program’s large icon Progress bar Best place for updates on progress Appears on your taskbar button
demo Taskbar - Overlays
Windows 7 Taskbar – Thumbnails Remote-control for a window For vital commands Accessible from taskbar thumbnail Up to seven buttons
Taskbar – Thumbnail Buttons and Clipping demo Taskbar – Thumbnail Buttons and Clipping
Restart and Recovery Register for Recovery Register for Restart Chance to save your information on another thread OS calls your code for you Register for Restart OS will run your app again (with a hint) after it dies
demo Restart and Recovery
Power Management Is the machine running on battery? What can your application do to extend battery life? Autosave less frequently Autosave before critical battery reached Scale back the user experience Graphics richness Reduce the frequency of data updates Stop spinning the CD for sound effects access Reduce CPU work loads Number of threads, thread priorities Use hardware (not software) rendering for graphics Turn off or constrain background processing Defer unnecessary tasks
demo Power Management
Code Pack Gets managed developers working on Windows 7 NOW WPF or Winforms C# or VB Not the only way to get there Some of this is coming in WPF (.NET 4) You could do your own interop – but why? Others have written other wrappers Documentation and samples Discussions on Code Gallery If you need to change or redistribute, you can http://code.msdn.com/WindowsAPICodePack
question & answer
Resources Required Slide Speakers, www.microsoft.com/teched TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. Resources www.microsoft.com/teched Sessions On-Demand & Community www.microsoft.com/learning Microsoft Certification & Training Resources http://microsoft.com/technet Resources for IT Professionals http://microsoft.com/msdn Resources for Developers
Complete an evaluation on CommNet and enter to win an Xbox 360 Elite!
Required Slide © 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.