The Windows API Code Pack: Add Windows 7 Features to Your Application

Slides:



Advertisements
Similar presentations
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

Session 1.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Paul Foster Developer Evangelist Microsoft Windows 7 – Top Features for your Applications SESSION CODE: W00T!
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Developing with the Windows API Code Pack for.NET Framework.
Windows 7 – A developer’s Guide to Building Killer Windows 7 Applications Bijoy Singhal │ Developer Evangelist, Microsoft India.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

How We Do Language Design at Microsoft (C#, Visual Basic, F#)
6/5/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Tech·Ed  North America /11/ :01 AM SESSION CODE: DEV405
Using Microsoft Visual Basic to Build Windows Phone Applications
Tech·Ed North America /19/2018 3:29 PM
9/11/2018 5:53 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
MDOP: Advanced Group Policy Management 4.0
Tech Ed North America /13/ :13 AM Required Slide
Tech·Ed North America /14/2018 7:13 PM
Marian Luparu Program Manager Microsoft Session Code: DEV308
Возможности Excel 2010, о которых следует знать
Microsoft Visual Studio IDE Futures
Overview of Social Computing in Microsoft SharePoint 2010
Customer Experiences With Business Intelligence
Implementing RESTful Services Using the Microsoft .NET Framework
Sysinternals Tutorials
T-SQL Power! The OVER Clause: Your Key to No-Sweat Problem Solving
Title of Presentation 11/22/2018 3:34 PM
What’s New In ASP.NET MVC 2
Matt Masson Software Development Engineer Microsoft Corporation
Jason Zander Unplugged
Branching and Merging Practices
Title of Presentation 12/2/2018 3:48 PM
High Availability: A Contrarian View
12/5/2018 3:24 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows 7 Deployment en Masse
Team Foundation Server 2010 for Everyone
Authoring for Microsoft Silverlight 4 with Microsoft Expression Blend
Tech Ed North America /1/ :36 AM Required Slide
Tech Ed North America /1/2019 2:58 AM Required Slide
Tech·Ed North America /17/2019 1:47 AM
Building Silverlight Apps with RIA Services
Tech Ed North America /12/2019 6:45 AM Required Slide
Silverlight Debugging
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
A Lap Around Internet Explorer 9 For Developers
2010 Microsoft BI Conference
Hack-proofing your Clients using Windows 7 Security!
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Lap Around the Windows Azure Platform
Code First Development in Microsoft ADO.NET Entity Framework 4.1
The Windows API Code Pack
Building BI applications using PowerPivot for Excel
Title of Presentation 5/24/2019 1:26 PM
Tech·Ed North America /6/2019 7:10 PM
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
Tech Ed North America /6/2019 2:07 PM Required Slide
Tech·Ed North America /7/2019 2:30 PM
TechEd /5/2019 2:08 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
WCL425 App Compat for Nerds Chris Jackson.
Presentation transcript:

The Windows API Code Pack: Add Windows 7 Features to Your Application Tech Ed North America 2010 2/23/2019 6:28 PM Required Slide SESSION CODE: WCL316 The Windows API Code Pack: Add Windows 7 Features to Your Application Kate Gregory Gregory Consulting www.gregcons.com/kateblog, @gregcons © 2010 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.

Agenda What is different about Windows 7? Visuals Fundamentals Taskbar jumplists Taskbar overlays – icons and progress bars Thumbnail buttons and custom thumbnails Fundamentals Power awareness Network awareness Libraries Restart and recovery

Accessibility from managed code Directly-callable using. NET interop mechanisms Eg RSS, Office C++/CLI or PInvoke signatures Eg Application Recovery and Restart Raw Win32 Eg Power Management, Windows Vista Wizards COM Eg Search and Organize APIs Extra difficult to call from managed code Eg Common File Dialogs, Network Awareness Easy Hard

What is the Windows API Code Pack? Managed class library to access to Windows 7 features Windows Shell namespace Windows Vista and Windows 7 Task Dialogs Support for Shell property system Taskbar Jump Lists, 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.microsoft.com/windowsapicodepack

Highlights from Windows API Code Pack All demos are from the samples that ship with it All demos are provided 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

What You Will See Taskbar Jumplists Taskbar Overlays Taskbar Thumbnail Buttons Restart and Recovery Power Management

DEMO Taskbar - Jumplists Tech Ed North America 2010 2/23/2019 6:28 PM © 2010 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.

Taskbar Jumplists Private jumpList As JumpList Tech Ed North America 2010 2/23/2019 6:28 PM Taskbar Jumplists Private jumpList As JumpList jumpList.AddToRecent(fileName) jumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent category1 = new JumpListCustomCategory(“My Category 1") jumpList.AddCustomCategories(category1) category1.AddJumpListItems(New JumpListItem(path)) Dim p As String = Path.Combine(systemFolder, "notepad.exe") Dim ir As IconReference = New IconReference(p, 0) Dim jll As JumpListLink = New JumpListLink(p, "Open Notepad") jll.IconReference = ir jumpList.AddUserTasks(jll) © 2010 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.

DEMO Taskbar - Overlays Tech Ed North America 2010 2/23/2019 6:28 PM © 2010 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.

Tech Ed North America 2010 2/23/2019 6:28 PM Taskbar Overlays TaskbarManager windowsTaskbar = TaskbarManager.Instance windowsTaskbar.SetOverlayIcon(Me.Handle, My.Resources.Green, "Green") windowsTaskbar.SetProgressState( TaskbarProgressBarState.Error) windowsTaskbar.SetProgressValue( currentValue, maxValue) © 2010 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.

Taskbar – Thumbnail Buttons and Clipping Tech Ed North America 2010 2/23/2019 6:28 PM Taskbar – Thumbnail Buttons and Clipping DEMO © 2010 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.

Taskbar Thumbnails buttonFirst = New ThumbnailToolbarButton( Tech Ed North America 2010 2/23/2019 6:28 PM Taskbar Thumbnails buttonFirst = New ThumbnailToolbarButton( My.Resources.first, "First Image") AddHandler buttonFirst.Click, AddressOf buttonFirst_Click TaskbarManager.Instance.TabbedThumbnail. SetThumbnailClip(Me.Handle, New Rectangle(pictureBox1.Location, pictureBox1.Size)) © 2010 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.

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 Tech Ed North America 2010 2/23/2019 6:28 PM © 2010 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.

Restart and Recovery ApplicationRestartRecoveryManager. Tech Ed North America 2010 2/23/2019 6:28 PM Restart and Recovery ApplicationRestartRecoveryManager. RegisterForApplicationRestart( new RestartSettings("/restart", RestartRestrictions.None)); RecoveryData data = new RecoveryData( new RecoveryCallback(RecoveryProcedure), null); RecoverySettings settings = new RecoverySettings(data, 0); RegisterForApplicationRecovery(settings); © 2010 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.

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 Tech Ed North America 2010 2/23/2019 6:28 PM © 2010 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.

Power Management PowerManager.PowerSourceChanged += Tech Ed North America 2010 2/23/2019 6:28 PM Power Management PowerManager.PowerSourceChanged += new EventHandler(PowerSourceChanged); PowerManager.PowerPersonality PowerManager.PowerSource PowerManager. GetCurrentBatteryState(). EstimatedTimeRemaining © 2010 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.

Code Pack Gets managed developers working on Windows 7 now WPF or Windows Forms C# or VB Not the only way to get there Some of this is 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

Windows API Code Pack Roadmap June 2011 2.0 Expanded Shell API coverage 1.0 Initial release Aug 2009 1.0.5 cleanups Mid July 2010 1.0.1 Bug fixes Nov 2009 1.5 Fundamentals Jan 2011

Taskbar Restart and Recovery Power Awareness What you’ve seen Jumplists – nouns and verbs Icon overlays Progress bar overlays Thumbnail buttons Thumbnail clipping Restart and Recovery Power Awareness

Call to Action Download Code Pack http://code.msdn.microsoft.com/windowsapicodepack Add functionality to your application so it lights up on Win 7 Feels like a Windows 7 app (taskbar etc.) Never lose unsaved data to a crash again Power efficiency and thoughtfulness

Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Tech Ed North America 2010 2/23/2019 6:28 PM Track Resources Learn about Windows Client Development: http://developforwindows.com Try out the Internet Explorer 9 Platform Preview: www.ietestdrive.com Interested in Windows hardware or software? Check it out: http://ReadySet7.com © 2010 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.

Resources Learning Required Slide www.microsoft.com/teched Tech Ed North America 2010 2/23/2019 6:28 PM Required Slide Resources Learning Sessions On-Demand & Community Microsoft Certification & Training Resources www.microsoft.com/teched www.microsoft.com/learning Resources for IT Professionals Resources for Developers http://microsoft.com/technet http://microsoft.com/msdn © 2010 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.

Complete an evaluation on CommNet and enter to win! Tech Ed North America 2010 2/23/2019 6:28 PM Required Slide Complete an evaluation on CommNet and enter to win! © 2010 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.

Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st http://northamerica.msteched.com/registration   You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year

Tech Ed North America 2010 2/23/2019 6:28 PM © 2010 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. © 2010 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.

Required Slide Tech Ed North America 2010 2/23/2019 6:28 PM © 2010 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.