<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://windowsteamblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Windows 7 for Developers : Microsoft</title><link>http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx</link><description>Tags: Microsoft</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>Fishbowl for Facebook Using the Windows 7 Taskbar for Extra Spice</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/11/19/fishbowl-for-facebook-using-the-windows-7-taskbar-for-extra-spice.aspx</link><pubDate>Fri, 20 Nov 2009 01:41:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:529030</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=529030</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/11/19/fishbowl-for-facebook-using-the-windows-7-taskbar-for-extra-spice.aspx#comments</comments><description>&lt;p&gt;During Wednesday&amp;rsquo;s keynote, Brian Goldfarb demoed an amazing&amp;nbsp;Silverlight 4 client for Facebook. Beyond its amazing looks,&amp;nbsp;this Silverlight 4&amp;nbsp;demo&amp;nbsp;provides a full and complete desktop client application for Windows (and Mac). SilverFace is built on top of Silverlight 4 &amp;ndash; also announced during the keynote. If you want a cool Facebook client application to work on from your Windows desktop, you should take a look&amp;nbsp;at the&amp;nbsp;&lt;a href="http://www.fishbowlclient.com/"&gt;&lt;strong&gt;Fishbowl for Facebook Preview&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;. &lt;/strong&gt;Fishbowl is a great WPF application that you can install and enjoy as a user, and at the same time it is a&amp;nbsp;great code sample for developers whom are looking to write&amp;nbsp;WPF applications that use Windows 7 features.&amp;nbsp; If you are interested, you can &lt;a href="http://fishbowl.codeplex.com/"&gt;download the source code for Fishbowl&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In today's world, the client&amp;rsquo;s experience is more important than ever before. Your application doesn&amp;rsquo;t just have to be fun and interesting; it has to be good looking, polished, and functional, providing a &amp;ldquo;natural&amp;rdquo; user experience that just works. As a developer, you need to push the envelope and use any available technical tool that the OS provides or any other available means (if installed on mobile devices) to provide a superior user experience, or users will switch to the next guy. In such a competitive scenario, using the Windows 7 Taskbar to shave a few seconds from day-to-day tasks looks like a very obvious choice.&lt;/p&gt;
&lt;p&gt;Both Silverlight 4 demo and Fishbowl applications each provide a great UX and enhance user productivity. Scott Guthrie also announced the &lt;a href="http://msdn.microsoft.com/en-us/windows/ee388574.aspx"&gt;Facebook SDK&lt;/a&gt; for managed code applications that combines the latest in Web and Client platform innovations with leading Social technologies (services) to help developers plug into Facebook. But, beside the new Facebook SDK and beside the great looks, the Fishbowl application is a great WPF (3.5) example that demonstrates how to write applications that produce amazing experiences on Windows 7.&lt;/p&gt;
&lt;p&gt;As a WPF application, Fishbowl runs on multiple Windows versions, including Windows XP, Windows Vista, and Windows 7, and it integrates with the Windows 7 Taskbar and Multitouch. One of the main ideas behind the Taskbar is to provide users with quick and easy access to their content and help them accomplish tasks and navigate between windows easier and with more confidence. For example, JumpList provides a great tool for surfacing common work items and tasks. If you have a task that you perform once or twice a day, taking two or three clicks to perform the task is not that bad. However, if you have a task that you perform 10, 20, or even 30 more times, using JumpList tasks or items in the recent category list goes a long way. Facebook users often check their wall, write notifications and messages, view friends' pictures, and so on. Therefore, in some scenarios, the Taskbar JumpList tasks, icon notification, thumbnail buttons, and other functionality become major tools in the application. &lt;/p&gt;
&lt;p&gt;Fishbowl uses the taskbar to provide a quick, easy, and seamless integration with Facebook functionality directly from your Taskbar. Let&amp;rsquo;s review some of the user functionality before jumping into code behind. &lt;/p&gt;
&lt;table width="551" cellpadding="2" cellspacing="0" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="265" valign="top"&gt;The Fishbowl taskbar offers a few tasks even before you start your application. You can go to Facebook.com, or you can actually &amp;ldquo;jump&amp;rdquo; directly and see your wall, friend's picture, and more, as the following image shows. &lt;br /&gt;One of the amazing things in Fishbowl for Facebook is that it changes it functionality between the different modes of the application. Being able to use the taskbar differently for&lt;/td&gt;
&lt;td width="284" valign="top"&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/TaskbarBeforeStart_5F00_119ECE9E.png"&gt;&lt;img height="229" width="240" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/TaskbarBeforeStart_5F00_thumb_5F00_57AF8BB1.png" alt="TaskbarBeforeStart" border="0" title="TaskbarBeforeStart" style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;different scenarios provides an amazing user experience in heavily used application like Fishbowl.&lt;/p&gt;
&lt;p&gt;When Fishbowl runs in normal mode, the Taskbar JumpList reflects items and tasks that you can actually perform in the context of a running application, like viewing the last few notifications and messages that you received without opening the application, as shown by the following image.&lt;/p&gt;
&lt;table width="551" cellpadding="2" cellspacing="0" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="225" valign="top"&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/TaskbarAfterStart_5F00_6C052B6F.png"&gt;&lt;img height="265" width="164" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/TaskbarAfterStart_5F00_thumb_5F00_191A183E.png" alt="TaskbarAfterStart" border="0" title="TaskbarAfterStart" style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" /&gt;&lt;/a&gt; &lt;/td&gt;
&lt;td width="324" valign="top"&gt;If you hover with the mouse above the Fishbowl control, you see the thumbnail preview provided by Windows 7 taskbar. However, Fishbowl uses the thumbnail button again allowing you to both view a preview of the application and act immediately upon the thumbnail preview as shown in the following image.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If you hover with the mouse above the Fishbowl control, you see the thumbnail preview provided by Windows 7 taskbar. However, Fishbowl uses the thumbnail button again allowing you to both view a preview of the application and act immediately upon the thumbnail preview as shown in the following image.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/thumbnailbutton_5F00_1CB8331B.png"&gt;&lt;img height="445" width="472" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/thumbnailbutton_5F00_thumb_5F00_1E58D922.png" alt="thumbnail button" border="0" title="thumbnail button" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;(And thank you Raman for writing so many PDC tweets J)&lt;/p&gt;
&lt;p&gt;Fishbowl also has a mini-mode operation mode. This mode shows just one message in a small window. As you can see in the following image, a small arrow allows you to switch between messages. When you hover over Fishbowl taskbar icon, you can see the preview but you can also control the message, again using the taskbar thumbnail preview.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/minimode_5F00_7A7001C7.png"&gt;&lt;img height="447" width="545" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/minimode_5F00_thumb_5F00_36D850A5.png" alt="minimode" border="0" title="minimode" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Besides great Taskbar integration, Fishbowl offers a great Multitouch experience, allowing you to scroll between messages using your finger to touch the touch screen. It is a little hard to illustrate Multitouch with screen capture so you will have to trust me on this one. &lt;/p&gt;
&lt;p&gt;We've covered most of the Fishbowl features unique to Windows 7, and in the next post I will dive into the API that enabled these Taskbar and Multitouch features. If you are interested, you can &lt;a href="http://fishbowl.codeplex.com/"&gt;download the source code for Fishbowl&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=529030" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows/default.aspx">Windows</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Multi-Touch/default.aspx">Multi-Touch</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sample+Code/default.aspx">Sample Code</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/PDC09/default.aspx">PDC09</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/PDC2009/default.aspx">PDC2009</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+API+Code+Pack/default.aspx">Windows API Code Pack</category></item><item><title>New Windows API Code Pack Version</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/11/18/new-windows-api-code-pack-version.aspx</link><pubDate>Thu, 19 Nov 2009 00:02:42 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:528968</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=528968</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/11/18/new-windows-api-code-pack-version.aspx#comments</comments><description>&lt;p&gt;I am glad to announce that today we shipped a new version of the &lt;a href="http://code.msdn.microsoft.com/WindowsAPICodePack"&gt;Windows API Code Pack&lt;/a&gt; – version 1.0.1. This is not a major version with a lot of new features, but rather a minor version focused on fixing bugs, improving performance, adding demos and few features updates (new wrappers…) &lt;/p&gt;  &lt;p&gt;But before we dive into this new version of the Windows Code Pack let’s better understand what this Windows API Code Pack is all about. &lt;/p&gt;  &lt;p&gt;Windows 7 offers new features like the taskbar, libraries, and the Sensor and Location platform, to name a few. These features enable new scenarios and create new opportunities for developers to make their applications shine on Windows 7. All these great features are exposed via the Win32 native API. Currently there is no “Windows 7” namespace in the .NET Framework, and no easy way to use these features from managed code applications. To help managed code developers access them, we released version 1.0 of the Windows API Code Pack for the .NET Framework in August (just after Windows 7 RTM). &lt;/p&gt;  &lt;p&gt;The Windows API Code Pack &lt;b&gt;is&lt;/b&gt; a &lt;b&gt;free&lt;/b&gt;, managed&lt;b&gt; Source Code Library &lt;/b&gt;provided by Microsoft &lt;b&gt;as is&lt;/b&gt;. You should consider this library as if &lt;b&gt;you wrote it yourself&lt;/b&gt;, as if it &lt;b&gt;is your own code&lt;/b&gt;. It is a great starting point and provides a really good and solid solution for managed code developers. It covers a lot of the new Windows 7 features as well as some more fundamental core features from the Windows Vista timeframe. You may think of the Windows API Code Pack as the closest thing to an “official” managed API for Windows. But you need to remember that it’s not a product with 24x7 technical support available from Microsoft Customer Service and Support. We believe it is a great solution, and that the codebase is very solid and high quality. &lt;/p&gt;  &lt;p&gt;Our goal with the code pack is to enable managed code developers to take advantage of Windows APIs that are not part of the .NET Framework. We feel that as a shared source that is separate from the .NET runtime libraries, the Windows API Code Pack provides an optimal compromise between the Microsoft Win32 managed wrapper, short time-to-market -we released the Windows API Code Pack just a month after the Win7 RTM, and we ship full source code of the library.&lt;/p&gt;  &lt;p&gt;The Windows API Code Pack includes a great deal of managed API for Windows (7). For example:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Extensive integration with the Windows Shell namespace, with support for the Windows Shell property system, providing control like explorer browser and access to Windows Libraries &lt;/li&gt;    &lt;li&gt;A completely 100% feature parity with the native Taskbar API including (but not limited to) JumpLists, Icon Overlay, Progress bar, Thumbnail, custom switcher, Thumbnail Button, etc… &lt;/li&gt;    &lt;li&gt;Windows Task Dialogs , other controls &lt;/li&gt;    &lt;li&gt;Support for Direct3D 11.0 and DXGI 1.0/1.1 APIs &lt;/li&gt;    &lt;li&gt;Support for the Sensor Platform APIs &lt;/li&gt;    &lt;li&gt;Extended Linguistic Services APIs &lt;/li&gt;    &lt;li&gt;Windows Restart Manager &lt;/li&gt;    &lt;li&gt;Power APIs &lt;/li&gt;    &lt;li&gt;And many other features &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Each technology represented in the Windows API Code Pack has multiple demos and examples (including source) in C# and VB. We are planning on releasing updates to the Windows API Code Pack roughly every three months. We will be investing mainly in stability (meaning fixing bugs), fundamentals, testing and documentation, as well as new feature support (based on customer feedback).&lt;/p&gt;  &lt;p&gt;You may ask yourself, “&lt;b&gt;Why isn't the Windows API Code Pack part of the .NET Framework?&lt;/b&gt;” &lt;/p&gt;  &lt;p&gt;We ship open source code that we might bring into the runtime sometime in the future, if we feel it's sufficiently core to the entire framework to be worth the size increase. Remember the .NET Framework runs on both Windows Vista and Windows XP. However, Windows 7 is here now, and we want to enable you to access this set of free, open source library sooner rather than later. We’re shipping this library in a community-supported form and, as you can see, we intend to keep updating it. While this version (1.0.1) is a minor release, we are planning on another release in the next few months. In the meantime, you get the best of both worlds in a package that you can use as a whole or in parts without restriction.&lt;/p&gt;  &lt;p&gt;Another question you may ask is, “&lt;b&gt;Will .NET 4 replace the need to use the Windows API Code pack&lt;/b&gt;?”&lt;/p&gt;  &lt;p&gt;When .NET 4 ships, you will be able to use its Windows 7 features such as Taskbar and multitouch integration with WPF, DirectWrite support, and the location API via the Devices namespace. Continue to access other features such as libraries, Restart Manager, and Sensors via the Windows API Code Pack. &lt;/p&gt;  &lt;p&gt;Last but not least, we are looking for feedback from the community – that is you the .NET developer using this library to write managed code applications for Windows 7. On the &lt;a href="http://code.msdn.microsoft.com/WindowsAPICodePack"&gt;Windows API Code Pack site&lt;/a&gt;, you can ask questions, provide feedback, report bugs, and follow open bugs. Your input is critical for the continuation of this library, so please send us your feedback and questions. &lt;/p&gt;  &lt;p&gt;To learn more about how to use the Windows API Code Pack check the &lt;a href="http://channel9.msdn.com/learn/courses/Windows7/" target="_blank"&gt;Windows 7 Training on Channel 9&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=528968" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows/default.aspx">Windows</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sensor+and+Location/default.aspx">Sensor and Location</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Libraries/default.aspx">Libraries</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sample+Code/default.aspx">Sample Code</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+API+Code+Pack/default.aspx">Windows API Code Pack</category></item><item><title>Programming Windows 7 Using Visual Studio 2010</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/11/17/programming-windows-7-using-visual-studio-2010.aspx</link><pubDate>Wed, 18 Nov 2009 01:55:24 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:528861</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=528861</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/11/17/programming-windows-7-using-visual-studio-2010.aspx#comments</comments><description>&lt;table border="0" cellspacing="0" cellpadding="2" width="561"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="350"&gt;         &lt;p&gt;A few weeks ago, just two days before Windows 7 become generally available, Visual Studio 2010 hit its own major milestone with the release its second Community Technical Preview of Visual Studio, known as Visual Studio 2010 Beta 2. To me, it is always exciting to see how the different tools and frameworks evolve and add new features.&amp;#160; It seems that with every release the products get bigger and better, offering an even &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="209"&gt;         &lt;br /&gt;          &lt;br /&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/VSLogo_5F00_4635271E.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 20px; display: inline; border-top: 0px; border-right: 0px" title="VSLogo" border="0" alt="VSLogo" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/VSLogo_5F00_thumb_5F00_1E8EAAF4.png" width="220" height="165" /&gt;&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;greater number of programming&amp;#160; languages, and addressing an ever growing number of areas of development such as Web, client, mobile, parallel, consoles, and devices.&lt;/p&gt;  &lt;p&gt;Despite being a “beta” product, it is much easier to work with Visual Studio 2010 than with VS 2008. It is much easier to control your solutions and, even more importantly, much easier to write and document code. The user interface is much improved; it uses the Windows Presentation Foundation (WPF) to reduce clutter and visual complexity, and modernizes the interface by removing outdated 3D bevels. Using WPF enables us to help developers focus on content areas by opening up negative space between windows and drawing attention to the current focus with a dominant accent color and a distinctive background. There are also some cool, small, and simple perks like the ability to control the size of text. You can also drag a single window from the main Visual studio application to a second monitor (just like that) and with that you have multi-monitor support via the VS client application.&lt;/p&gt;  &lt;p&gt;Improvements to the IntelliSense allow it finally to work well for C++ projects. And let’s not forget the new debugger window that supports parallel computing debugging and lets you view your parallel stacks. &lt;/p&gt;  &lt;p&gt;There is even a new language, F# (F stands for Functional programming), and numerous upgrades to C#, like support for dynamic keywords. Dynamic objects' operations are resolved at runtime (check out a &lt;a href="http://www.hanselman.com/blog/C4AndTheDynamicKeywordWhirlwindTourAroundNET4AndVisualStudio2010Beta1.aspx"&gt;good post&lt;/a&gt; about this by Scott Hanselman). There is also support for the next version of the C++ language specification, C++X0, like Lambda Expressions. Speaking of C++, we've built the C++ solutions using MSBuild, which should make everyone happy.&lt;/p&gt;  &lt;p&gt;As always, backward compatibility is super critical, and it is important to mention that Visual Studio 2010 supports multi-targeting. Visual Studio 2010 can target .NET 2.0 through .NET 4.0 on a per-project basis, which means you can work with your older project on the new VS 2010 and enjoy all the goodies mentioned above (and many more).&lt;/p&gt;  &lt;p&gt;But I want to focus this post on using Visual Studio 2010 to program Windows 7. There are quite few technologies and features in Visual Studio 2010 to help you write better applications targeting the specific features of Windows 7. Below are just a few of the Visual Studio 2010 features that we’ll write more about really soon. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;.NET 4 and Windows 7&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Visual Studio 2010 brings a complete new CLR version – version 4. This is not just an incremental upgrade on top of CLR 2 (.NET Framework 2). This enables new language enhancements like the dynamic keyword. And the new WPF brings support in a few other areas like shell and Taskbar integration, and multitouch. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;WPF &amp;amp; Taskbar Integration &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;As you know, you program jump lists using the &lt;b&gt;JumpList&lt;/b&gt; class. This exposes several methods and properties that manipulate the exposed jump lists for the application. It also has an attached property that you can apply to your application class to create, modify, and remove jump list items. If you work with specific files, you can use the JumpList.AddToRecentCategory method to add that file to the recently used file list managed by the shell.&lt;/p&gt;  &lt;p&gt;There are two types of jump lists – &lt;i&gt;tasks&lt;/i&gt; and &lt;i&gt;items&lt;/i&gt;; you work with each using a &lt;b&gt;JumpTask&lt;/b&gt;, or a &lt;b&gt;JumpPath&lt;/b&gt; respectively. You can work with these in XAML, code-behind, or a combination of the two. The following code snippet shows a simple integration of tasks into a jump list.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;JumpList.JumpList&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;JumpList&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;JumpTask&lt;/span&gt; &lt;span class="attr"&gt;ApplicationPath&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;notepad.exe&amp;quot;&lt;/span&gt; 
                         &lt;span class="attr"&gt;CustomCategory&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;External Tools&amp;quot;&lt;/span&gt; 
                &lt;span class="attr"&gt;Description&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Take Notes&amp;quot;&lt;/span&gt; 
                &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Start Notepad&amp;quot;&lt;/span&gt; 
                &lt;span class="attr"&gt;IconResourcePath&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;notepad.exe&amp;quot;&lt;/span&gt; 
                &lt;span class="attr"&gt;IconResourceIndex&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;

      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;JumpTask&lt;/span&gt; &lt;span class="attr"&gt;ApplicationPath&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;calc.exe&amp;quot;&lt;/span&gt;
                         &lt;span class="attr"&gt;CustomCategory&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;External Tools&amp;quot;&lt;/span&gt; 
                         &lt;span class="attr"&gt;Description&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Perform some calculations&amp;quot;&lt;/span&gt; 
                        &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Start Calculator&amp;quot;&lt;/span&gt;
                        &lt;span class="attr"&gt;IconResourcePath&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;calc.exe&amp;quot;&lt;/span&gt; 
                        &lt;span class="attr"&gt;IconResourceIndex&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;JumpList&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;JumpList.JumpList&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;In a similar way, you can use XAML to add Thumbnail Toolbar buttons as shown by the following code snippet.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TaskbarItemInfo.ThumbButtonInfos&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ThumbButtonInfo&lt;/span&gt; &lt;span class="attr"&gt;DismissWhenClicked&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt; 
                    &lt;span class="attr"&gt;ImageSource&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;images/booktrip.png&amp;quot;&lt;/span&gt;
                    &lt;span class="attr"&gt;Command&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{Binding BookItinerary}&amp;quot;&lt;/span&gt;
                    &lt;span class="attr"&gt;Description&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Book the itinerary now&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TaskbarItemInfo.ThumbButtonInfos&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;WPF Common File Dialog Supports Libraries (Finally!)&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;For some strange reason, WPF 3 and 3.5 Common File Dialog (CFD) didn’t support the updated version of the CFD introduced with Windows Vista. The CFD was upgraded in Windows 7 to support libraries and provide a better user experience. It now allows seamless search integration as well as some advanced user functionality. With WPF 4, applications enjoy the power of the “new” CFD directly from WPF, and don’t need to import CFD from the WinForm namespace (which was the only way to show the updated CFD from WPF 3 and WPF 3.5).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;WPF Supports Multitouch&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;WPF 4.0 introduces multitouch support directly into the WPF API– with no need to interop to a native service. These new features are only available on Windows 7 and are automatically deprecated when running under older operating systems, so you don’t have to detect the operating system yourself. WPF 4.0 adds a new manipulation API to the UIElement base class. This new support allows developers to track multiple touches and generate both cumulative and individual manipulations across the touches. Basically, this enables you to transform your object on the X and Y coordinates, rotation, and scale. &lt;/p&gt;

&lt;p&gt;WPF will supply these manipulation events if the &lt;b&gt;IsManipulationEnabled&lt;/b&gt; property on the element is set to true. It defaults to false, so you will need to turn on this property for each element where you want to manage manipulations. This is as simple as adding IsManipulationEnabled=true to your XAML as shown in the following code snippet. &lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Border&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10,5&amp;quot;&lt;/span&gt; 
    &lt;span class="attr"&gt;BorderBrush&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;DarkGoldenrod&amp;quot;&lt;/span&gt; 
    &lt;span class="attr"&gt;BorderThickness&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt; 
        &lt;span class="attr"&gt;CornerRadius&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10&amp;quot;&lt;/span&gt; 
    &lt;span class="attr"&gt;MinHeight&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;75&amp;quot;&lt;/span&gt; 
    &lt;span class="attr"&gt;IsManipulationEnabled&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Optionally, you can also hook the &lt;b&gt;ManipulationStarting&lt;/b&gt; and &lt;b&gt;ManipulationCompleted&lt;/b&gt; events to provide code behind the implementation of these events. &lt;/p&gt;

&lt;p&gt;WPF 4 also supports low-level touch messages, or raw touch input. You can interact with the raw touch events on any &lt;b&gt;UIElement&lt;/b&gt; using &lt;b&gt;TouchDown&lt;/b&gt;, &lt;b&gt;TouchMove,&lt;/b&gt; and &lt;b&gt;TouchUp&lt;/b&gt; events, all of which have preview event versions. This can be useful if you are trying to track multiple touches that are not manipulating the same object, or if you want to provide different behavior for touches and the mouse. We’ll soon write more about Windows 7 multitouch in general and WPF specifically. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;MFC Updates&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;In Visual Studio 2010, C++ and MFC received a healthy dosage of “coolness” factor, adding useful features such as IntelliSense enhancements and C++0x features. The MFC Library received a major upgrade, especially in regard to the Taskbar, Multitouch, and Restart and Recovery:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;i&gt;Taskbar&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The MFC Taskbar provides all the functionality that the native taskbar COM API provides. There is nothing that the one can do that the other cannot. The MFC simply wraps the Win32 APIs (as it always does) into a more “MFC-like” API that corresponds to the MFC Framework programming style guidelines. For example, the following code snippet sets the overlay icon.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;CMainFrame* mainFrm = 
dynamic_cast&amp;lt;CMainFrame*&amp;gt;(AfxGetApp()-&amp;gt;GetMainWnd());
&lt;span class="kwrd"&gt;if&lt;/span&gt; (mainFrm)
    mainFrm-&amp;gt;SetTaskbarOverlayIcon(IDI_ICON_INFO,L&lt;span class="str"&gt;&amp;quot;Info&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;First you need to obtain a handle (a pointer) to the application's main window (the top-level window), which corresponds to Win32 HWND. Then, simply call the SetTaskbarOverlayIcon passing HICON and a string that provides an alt text version of the information conveyed by the overlay to meet accessibility requirements. Simple, right?&lt;/p&gt;

&lt;p&gt;In MFC, the CFrameWnd class provides the functionality of a Windows single document interface (SDI), overlapped, or pop-up frame window. With the new MFC, this class was updated and now supports Taskbar functionality such as icon overlay, progress bar, jump lists, and thumbnails. &lt;/p&gt;

&lt;p&gt;In MFC, Taskbar thumbnail preview support is built in, so the Taskbar thumbnails will show any rendering within the views. Therefore, other than implementing your own View drawing, you need not provide any explicit code to update those Thumbnails.&lt;/p&gt;

&lt;p&gt;To enable Taskbar Thumbnails in an MFC application while using the MFC application wizard, all the user needs to do is select the “Multiple documents” application type with the option “Tabbed documents” enabled. When the application runs, MFC will take a snapshot of each view and send it to the Taskbar APIs to display as thumbnails.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_5D36703E.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_1508B462.png" width="535" height="422" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And the output could like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_13C41B83.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_58FC72AC.png" width="339" height="350" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;i&gt;Multitouch&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;In Visual Studio 2010, MFC also supports multitouch. By default, on a touch-enabled device (such as touch screen), Windows 7 sends gesture touch messages to any application; that is, by default Windows 7 sends WM_GESTURE messages to the target windows. All that MFC is doing is mapping these messages to its own message handlers. MFC provides a number of message handler overrides that can receive each of the gesture types, and each returns a Boolean value. If a gesture input is processed by the application, the corresponding override should return TRUE; otherwise, it returns FALSE. Therefore if you wish to handle the zoom gestures, all you need to do is implement the relevant handler. Here is the list of supported handlers.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Gesture handlers&lt;/span&gt;
&lt;span class="kwrd"&gt;virtual&lt;/span&gt; BOOL OnGestureZoom(CPoint ptCenter, &lt;span class="kwrd"&gt;long&lt;/span&gt; lDelta);
&lt;span class="kwrd"&gt;virtual&lt;/span&gt; BOOL OnGesturePan(CPoint ptFrom, CPoint ptTo);
&lt;span class="kwrd"&gt;virtual&lt;/span&gt; BOOL OnGestureRotate(CPoint ptCenter, &lt;span class="kwrd"&gt;double&lt;/span&gt; dblAngle);
&lt;span class="kwrd"&gt;virtual&lt;/span&gt; BOOL OnGesturePressAndTap(CPoint ptFirstFinger, &lt;span class="kwrd"&gt;long&lt;/span&gt; lDelta);
&lt;span class="kwrd"&gt;virtual&lt;/span&gt; BOOL OnGestureTwoFingerTap(CPoint ptCenter);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Similarly, you can register to receive raw touch messages and the default gesture messages. In Windows 7, gestures messages and raw touch are mutually exclusive. If you register to receive the raw touch messages for a particular window, that window will stop receiving gestures messages. If you opt-in to handle raw touch messages, you need to implement the following handler:&lt;/p&gt;
&lt;span class="kwrd"&gt;&lt;/span&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;virtual&lt;/span&gt; BOOL OnTouchInput(
                        CPoint pt, 
                        &lt;span class="kwrd"&gt;int&lt;/span&gt; nInputNumber, 
                        &lt;span class="kwrd"&gt;int&lt;/span&gt; nInputsCount, 
                        PTOUCHINPUT pInput);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;MFC makes your life easier by providing a lot of the information per each touch point, for example, the client coordinates for the actual point where the touch-enabled device has been touched. MFC also provides the ID of the touch point, that is, the first, second, or third finger, as well as the total count of current touches.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;i&gt;Restart and Recovery &lt;/i&gt;(&lt;i&gt;Restart Manager&lt;/i&gt;)&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;In Visual Studio 2010, MFC also provides native support of the Restart Manager. Restart Manager is a feature introduced by the Microsoft Windows Vista operating system. It can help applications maintain their data when an update needs to shutdown the application or when an unexpected software error or crash occurs. Instead of shutting down abnormally, Restart Manager enables an application to perform an application save before it is terminated. Furthermore, it can re-invoke the application, enabling it to restore its state from before the shutdown or crash. &lt;/p&gt;

&lt;p&gt;For new MFC applications, you can get the application restart and recovery feature for free by using the MFC Application Wizard as you can see from the following image:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/clip_5F00_image001_5F00_5DFEB05B.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/clip_5F00_image001_5F00_thumb_5F00_76221AB6.png" width="425" height="243" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All configurable parts of the restart manager API are exposed to the user through virtual members that can be over-ridden. Needless to say, you can expect some more blogging about this feature. &lt;/p&gt;

&lt;p&gt;&lt;b&gt;.NET 4 and Location&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;.NET 4 has a new Device namespace that supports the Windows 7 Location API (part of the Windows 7 Sensor and Location. The &lt;b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.device.location(VS.100).aspx"&gt;System.Device.Location&lt;/a&gt;&lt;/b&gt; namespace allows application developers to access the user's location easily using a single API. Location information may come from multiple providers, such as GPS, Wi-Fi triangulation, and cell phone tower triangulation. The System.Device.Location classes provide a single API to encapsulate the multiple location providers on a computer and support seamless prioritization and transitioning between them. An application developer using this API does not need to know which location-sensing technologies are available on a particular computer and is freed from the burden of tailoring an application to a specific hardware configuration.&lt;/p&gt;

&lt;p&gt;To begin accessing location, you need to create a &lt;b&gt;GeoLocationProvider&lt;/b&gt;. This object is the main “location manager” object through which you can register for &lt;b&gt;LocationChange&lt;/b&gt; notifications and synchronously read the latest location information. Next you need to call &lt;b&gt;Start&lt;/b&gt; to start the acquisition of data from the current location provider. You can check the &lt;b&gt;Status&lt;/b&gt; property to determine if data is available. If data is available, you can get the location once from the &lt;b&gt;Location&lt;/b&gt; property, or receive continuous location updates using the &lt;b&gt;LocationChanged&lt;/b&gt; event. The following code snippet is a VERY simple code sample showing how to retrieve the current GeoCoordinates (latitude, longitude). &lt;/p&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;GeoLocationProvider provider = &lt;span class="kwrd"&gt;new&lt;/span&gt; GeoLocationProvider();
provider.Start();
GeoCoordinate coordinate = provider.Location.Coordinate;
&lt;span class="kwrd"&gt;if&lt;/span&gt; (coordinate != GeoCoordinate.Unknown)
{
  &lt;span class="rem"&gt;//Business logic here&lt;/span&gt;
}&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately, .NET 4 supports only the Location API and not the full Sensor and Location Platform – meaning that the .NET location implementation is still missing the Sensor piece. Use the Windows API Code Pack to access sensor from managed code.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Parallel Computing and Windows 7 Multi-Core &lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Parallel programming in Visual Studio 2010 has many aspects, for example, Parallel LINQ and other .NET enhancements for supporting parallel computing, including statements like Parallel.For that use System.Threading.Tasks.Task. C++ developers will be happy to learn that the Task concepts also exist in C++ Version 10, which ships with VS 2010. For native code, Concurrency Runtime (ConcRT) has &lt;b&gt;implicit knowledge&lt;/b&gt; of &lt;a href="http://blogs.msdn.com/nativeconcurrency/archive/2009/02/04/concurrency-runtime-and-windows-7.aspx"&gt;&lt;b&gt;Win7 processor groups&lt;/b&gt;&lt;/a&gt; and will schedule work on up to 256 cores; ConcRT also takes advantage of User Mode Scheduling of threads. Therefore, any workload that sits on top of ConcRT immediately benefits. In other words, because both the Parellel Pattern Library (PPL) and Asynchronous Agents are included in Visual C++ 10 CRT and are built on top of ConcRT, any workloads you build on them will scale to 256 cores--&lt;/p&gt;

&lt;p&gt;just like that! (Well, you will still need to write the code, but the scaling is free.)&lt;/p&gt;

&lt;p&gt;For managed code applications, the story is less bright. Management of the managed stack thread sits on top of the .NET ThreadPool (System.Threading.ThreadPool) by default. This does not use the new processor group APIs in Windows 7, and therefore doesn’t automatically benefit from the Windows 7 ability to scale. The maximum number of processes that the threadpool can utilize is 64. But not everything is lost, it is possible to write a custom TaskScheduler that targeted more than 64 procs, and use the rest of the Task Parallel Library with &lt;b&gt;that special scheduler. This would be a cool CodePlex project, right?&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Overall Visual Studio 2010 includes tons of new technologies and improvements--all of it icing on the Windows 7 cake! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=528861" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows/default.aspx">Windows</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Multi-Touch/default.aspx">Multi-Touch</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sensor+and+Location/default.aspx">Sensor and Location</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category></item><item><title>Reporting Live from the Windows 7 Seminar: Boot Camp</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/11/16/reporting-live-from-the-windows-7-seminar-boot-camp.aspx</link><pubDate>Mon, 16 Nov 2009 20:07:11 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:528734</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=528734</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/11/16/reporting-live-from-the-windows-7-seminar-boot-camp.aspx#comments</comments><description>&lt;table border="0" cellspacing="0" cellpadding="2" width="502"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="351"&gt;Here we are at the LA Convention Center, attending the &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/10/07/free-windows-7-seminar-with-mark-russinovich-and-friends.aspx"&gt;FREE Windows 7 Seminar: Boot Camp&lt;/a&gt;. We managed to “&lt;b&gt;sell out&lt;/b&gt;” (just a reminder-- it is free) this event, getting more than 1200 registrations. This day is all about learning what’s new in the Windows 7 kernel, how developers can take advantage of these feature, and then learn how to take advantage of some “user mode” features like multitouch, taskbar, sensor and location, and others. &lt;/td&gt;        &lt;td valign="top" width="149"&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_3CE0E669.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_2378E32F.png" width="136" height="186" /&gt;&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Today started with &lt;a href="http://channel9.msdn.com/shows/Going%20Deep/Mark-Russinovich-Inside-Windows-7/"&gt;Mark Russinovich&lt;/a&gt;, Technical Fellow and the man behind &lt;a href="http://technet.microsoft.com/en-us/sysinternals/default.aspx"&gt;SysInternals&lt;/a&gt; and many of the improvements in Windows 7, describing some of the changes made to the Windows 7 kernel. Immediately after Mark, &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Arun-Kishan-Process-Management-in-Windows-Vista/"&gt;Arun Kishan&lt;/a&gt;, a Principal Architect for the process management components, described his work around the thread and process allocation that frees the kernel from its thread dispatcher locks and gives Windows 7 the ability to scale seamlessly to 256 cores. Then &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Landy-Wang-Windows-Memory-Manager/"&gt;Landy Wang&lt;/a&gt;, a Distinguished Engineer in the Kernel team, described changes made in Windows 7 memory management, mainly focusing on memory Working Set and memory trimming.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_0A10DFF5.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_58C1F594.png" width="551" height="424" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;After lunch, Jaime started his run, giving some insight and very useful tips about using the Taskbar, from understanding the difference between Application ID and Program ID to the effective use of custom previews. Jaime has only 60 minutes, but I am sure his tips for working with the Taskbar will prove very useful. For example:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Tip1 – when writing your own jump list item or link, make sure you remember what items you wrote, because you can’t just “read” the jump list items&lt;/li&gt;    &lt;li&gt;Tip2 – if you decide to invest in cutom switcher and provide your own thumbnail preview and Aero Peak make sure you “save the state” of your application and images as DWM will not always perform for you.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I'll be up next, explaining Windows 7 libraries in depth, with a focus on useful tips for programming Windows 7 libraries, and specifically how to stay in sync with library updates. We have already had plenty of Windows 7 libraries posts - &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/06/11/windows-7-programming-guide-libraries.aspx"&gt;Windows 7 Programming Guide – Libraries&lt;/a&gt;, so I am not going into great detail. However, I do want to hand out the presentations and code samples used. &lt;strong&gt;All &lt;/strong&gt;my demos as well as Jaime’s are part of the &lt;a href="http://channel9.msdn.com/learn/courses/Windows7/"&gt;Windows 7 Training kit&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Right after our discussion about libraries, we will take a deep dive into the Windows 7 Sensor and Location platform. I just LOVE the endless amount of innovation and opportunity developers have generated while using this platform. After the Windows 7 launch on October 22&lt;sup&gt;nd&lt;/sup&gt;, we saw a large number of laptop models coming out with built-in sensors. Developers will most probably use these to create truly adaptive applications that adjust their functionality and UI based on sensor input.&amp;#160; &lt;/p&gt;  &lt;p&gt;After our Sensor and Location Platform discussion, it will be Michael Oneppo's turn to explain the changes in the Windows 7 graphics stack. Michael's presentation is very interesting, as it describes some of the DirectX API that was down ported to Windows 7 as a result of the &lt;a href="http://support.microsoft.com/kb/971644"&gt;Platform Update for Windows Vista and the Platform Update for Windows Server 2008&lt;/a&gt;. For example, did you know that the Microsoft Direct3D API DirectCompute feature allows your applications to use a new pipeline stage in the GPU, the &lt;b&gt;compute shader&lt;/b&gt; stage, to implement highly data-parallel algorithms with unmatched speed and performance? This means that now you can use GPU power for parallel programming, freeing your CPU to do other things. It is amazing how powerful these GPUs have become; allowing them remain idle would be a huge waste of resources. If you want to learn more, you can always view Chas Boyd PDC session – &lt;a href="http://microsoftpdc.com/Sessions/P09-16"&gt;DirectX11 DirectCompute&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;To close the learning part of the day, &lt;a href="http://blogs.msdn.com/jaimer/"&gt;Jaime Rodriguez&lt;/a&gt; takes us through a quick tour of Windows 7 multitouch. Jaime is taking his usual practical teaching approach of focusing on a few tips and tricks that will make it easier for you to start using multitouch. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=528734" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows/default.aspx">Windows</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/PDC09/default.aspx">PDC09</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/PDC2009/default.aspx">PDC2009</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Performance/default.aspx">Performance</category></item><item><title>Windows7 Trigger Start Services – Part 2: Building a Trigger Start Optimized Service</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/10/27/windows7-trigger-start-services-part-2-building-a-trigger-start-optimized-service.aspx</link><pubDate>Wed, 28 Oct 2009 00:13:21 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:527328</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=527328</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/10/27/windows7-trigger-start-services-part-2-building-a-trigger-start-optimized-service.aspx#comments</comments><description>&lt;p&gt;In the last post &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/10/26/windows7-trigger-start-services-part-1-introduction.aspx"&gt;Windows 7 Trigger Start Services – Part 1: Introduction&lt;/a&gt;, we introduced Windows7 Trigger Services as a great way to optimize your services to have better performance and improved security. In this post you will learn how to convert a standard automatic-start service to a trigger-start service that starts up only when a certain event occurs in the system. We’ll use a WPF application (obviously managed code) that registers and monitors a service (also implemented using .NET). To bridge between the .NET world and the native Win32 APIs that we saw in the previous post, we use a C++/CLI interoperability layer. &lt;/p&gt;  &lt;p&gt;This sample application has 3 parts:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A C++/CLI interoperability layer that provides a regular and easy .NET API to the controller application &lt;/li&gt;    &lt;li&gt;A WPF controller application that lets you register and run the service &lt;/li&gt;    &lt;li&gt;A simple .NET service that looks for a USB storage device (disk on key) and on it, a specific folder named “&lt;i&gt;ToCopy&lt;/i&gt;” from which to copy files to your local “&lt;i&gt;C:\FromUSB&lt;/i&gt;” folder &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The following image illustrates the solution structure.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_5FB98C22.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_5EE12638.png" width="217" height="373" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Let’s start by reviewing the .NET Service code implementation. This is a simple Windows service written in C#. The purpose of this service is to copy pictures automatically to your local hard-drive- “&lt;i&gt;c:\FromUSB&lt;/i&gt;” from the USB storage device that is plugged into your computer. &lt;/p&gt;  &lt;p&gt;The service implementation can be found at &lt;i&gt;USBService.cs&lt;/i&gt;. This class inherits the ServiceBase base class and overrides the &lt;i&gt;OnStart&lt;/i&gt; and &lt;i&gt;OnStop&lt;/i&gt; methods. This class has a &lt;i&gt;DoWork&lt;/i&gt; method that actually does all the copying of images from the USB disk to your local drive. The &lt;i&gt;DoWork&lt;/i&gt; method writes to a log file that we will be monitoring. &lt;/p&gt;  &lt;p&gt;The real interesting part of the service implementation is the &lt;i&gt;OnStart&lt;/i&gt; method. This method is called once the service is started. Notice that the first line of code checks whether the service is configured as a trigger start service. If the “if” statement returns false, we create a new instance of a timer and have it poll every 5 seconds. &lt;b&gt;Before&lt;/b&gt; Windows7, this was the only way to implement such a service, that is, by regularly polling the system to check for a USB device. Therefore, the service needs to run 24x7 to poll the system. This is highly wasteful of resources and keeps the system from transitioning to a low-power state, increases the application attack surface, among other negative things.&lt;/p&gt;  &lt;p&gt;But, with Windows7, you can configure such a service with a USB device arrival trigger. This means that the service will not run until a USB device arrives, specifically a USB generic disk device. We’ll get to that part of the solution in a second, but for now, if you look at the &lt;i&gt;OnStart&lt;/i&gt; method, you will notice that we check whether the service is configured as a trigger start service; if it is, we simply call the &lt;i&gt;DoWork&lt;/i&gt; method on another thread, as shown by the following code snippet. This should work just fine because the service is NOT running, and will start to run only when the trigger happens. And then it will not default to the timer, but rather use the thread pool to queue the work.&lt;/p&gt;  &lt;pre class="csharpcode"&gt; &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnStart(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)
 {
   &lt;span class="kwrd"&gt;if&lt;/span&gt; (ServiceControl.IsServiceTriggerStart(ServiceName))
   {
      ThreadPool.QueueUserWorkItem(_ =&amp;gt; DoWork());
   }
   &lt;span class="kwrd"&gt;else&lt;/span&gt;
   {
     _timer = &lt;span class="kwrd"&gt;new&lt;/span&gt; Timer(_ =&amp;gt; DoWork());
     _timer.Change(0, 5000);
   }
 }&lt;/pre&gt;

&lt;p&gt;The &lt;i&gt;ServiceControl&lt;/i&gt; namespace contains the C++/CLI interop layer. This layer uses C++/CLI as the binding element between the native API and the WPF application. The main ServiceControlInterop.cpp file contains all the functionality that we need and that is used by the WPF application. For example using the controller application we can use &lt;i&gt;AddService(…) &lt;/i&gt;or&lt;i&gt; RemoveService(…)&lt;/i&gt; to add or remove a service respectively. We can also configure the service as a trigger start service for either a USB device arrival or first available IP address by using &lt;i&gt;SetServiceTriggerStartOnUSBArrival&lt;/i&gt; or &lt;i&gt;SetServiceTriggerStartOnIPAddressArrival &lt;/i&gt;respectively. Reviewing both function implementations reveals that basically both are following identical paths. They:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;First, use &lt;em&gt;OpenSCManager&lt;/em&gt; to get a handle to the Service Control Manager (SCM) &lt;/li&gt;

  &lt;li&gt;Then use the SCM handle &lt;em&gt;OpenService&lt;/em&gt;, to get an actual service handle that we wish to configure &lt;/li&gt;

  &lt;li&gt;Finally call &lt;em&gt;ChangeServiceConfig2&lt;/em&gt; to set the specific trigger &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All this was explained in detail in the last post (&lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/10/26/windows7-trigger-start-services-part-1-introduction.aspx"&gt;Windows7 Trigger Start Services – Part 1: Introduction&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers.CodeSamples/TriggerStartServiceDemo.zip"&gt; download&lt;/a&gt; the code sample for this application. Note that you will have to run Visual Studio as administrator (see image below) because you will need to register, start, and stop services. . You will also need to Windows 7 SDK to compile the C++ part of the solution.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_49173DDB.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_2F4307AC.png" width="331" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;When compiling and running the default solution (the WPF application) you will see the following image. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_156ED17D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_34B17850.png" width="258" height="286" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This is the main WPF controller application. From here, you can create the service by clicking the Create Manual button.&lt;/p&gt;

&lt;p&gt;Next, open the Services Window by typing “Services” in the Start Menu search box. You should see the Service window. Locate the USBCopyService; it should appear as in the following image.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_2606CC6B.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_336CDF71.png" width="524" height="132" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Click the Run button and then the Refresh button in the Services window, or just press F5. You will not notice a great deal of change, but the USBCopyService changed from Manual to Started, as shown in the following image.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_2BE17004.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_0B5A3052.png" width="514" height="110" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;A second look at the actual application reveals the service activity in the log file. As you can see in the following image, the services awaken every 5 seconds and poll the system, looking for USB devices:&lt;/p&gt;
&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_18C04358.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_29C4713B.png" width="307" height="340" /&gt;&lt;/a&gt; 

&lt;p&gt;Click the Stop button to stop the service and then click the Delete Service to delete it. Now click the Trigger Start button to register and configure the service as a trigger start service that is triggered once a USB Generic disk arrives. If you check the Service window, you will see the USBCopyService listed as “manual” where in reality it is configured as triggered start service (there is just no graphical representation of that). &lt;/p&gt;

&lt;p&gt;If you plug in a USB disk with a “ToCopy” folder the service will kick into action and copy the files to c:\FromUSB. Not the best implementation, but hey, it is only a demo. The following image shows a single line in the log file because the service actually ran only once; it executed the &lt;i&gt;DoWork&lt;/i&gt; method and then quit. It didn’t run and poll the system every 5 seconds and didn’t waste resources or become a security liability.&lt;/p&gt;
&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_3AC89F1E.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_4EE1BBA7.png" width="335" height="372" /&gt;&lt;/a&gt; 

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;To conclude &lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Developing a service with Windows 7 trigger start service in mind might be a little more difficult than a regular “auto-run” service that just runs in idle from boot to shutdown. But in practice, all it takes is only a few lines of code, no more. And these few lines of code can have a very big affect in terms of resource consumption and security. So the next time you build a new Windows Service, try to incorporate triggers.&lt;/p&gt;

&lt;p&gt;You can learn about Windows 7 using the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1C333F06-FADB-4D93-9C80-402621C600E7&amp;amp;displaylang=en"&gt;Windows 7 Training Kit for Developers&lt;/a&gt; or by viewing Windows 7 videos on &lt;a href="http://channel9.msdn.com/windows"&gt;Channel 9&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also get &lt;a href="http://channel9.msdn.com/learn/courses/Windows7/BackgroundServices/"&gt;hands-on&lt;/a&gt; experience for Windows 7 Trigger Start Services using the &lt;a href="http://channel9.msdn.com/learn/courses/Windows7/"&gt;Windows 7 Online training&lt;/a&gt; that is part of the &lt;a href="http://channel9.msdn.com/learn/"&gt;Channel 9 Learning Center&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=527328" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Training+Kit/default.aspx">Windows 7 Training Kit</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Trigger+Start+Services/default.aspx">Trigger Start Services</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Performance/default.aspx">Performance</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Trigger+Start+Services/default.aspx">Windows 7 Trigger Start Services</category></item><item><title>Windows7 Trigger Start Services – Part 1: Introduction</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/10/26/windows7-trigger-start-services-part-1-introduction.aspx</link><pubDate>Mon, 26 Oct 2009 18:42:17 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:527263</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=527263</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/10/26/windows7-trigger-start-services-part-1-introduction.aspx#comments</comments><description>&lt;p&gt;We introduced &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/10/01/session-0-isolation.aspx"&gt;Service 0 Isolation&lt;/a&gt; a few weeks ago as an application compatibility topic. It is only natural that we continue our conversation about services in the context of Windows 7. But this time, we will talk about some of the benefits to service optimization that are available in Windows 7. This post focuses on a new feature in Windows 7 called &lt;b&gt;Trigger Start Services&lt;/b&gt;. But before we jump into the API, let’s provide some background about services.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;What Are Services?&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;A service is an integral mechanism built into Microsoft Windows operating systems. You can think of services as “special applications” that run with no regard to the current user context. Services are different from “regular” user applications because you can configure a service to run from the time a system starts up (boots) until it shuts down, without requiring an active user to be present – that is, services can run even though no users are logged on. &lt;/p&gt;  &lt;p&gt;We like to think about services as running tasks for us in the background without interfering with user operations. Services on Windows are responsible for all kinds of background activity that do not involve the user, ranging from the Remote Procedure Call (RPC) service, through Printer Spoolers, to the Network Location Awareness service.&lt;/p&gt;  &lt;p&gt;Over the years, Windows has grown and with it the number background services. But to be honest, background services in Windows are a pain – the operating system ships with a lot of them in the box. On top of that, ISVs and their applications add even more services, like software updates to name only one. With that said, some of these services are critical and are required during boot sequences, some are required later when a specific user logs on, while others don’t need to execute until they are called upon. Nonetheless, when you look at the currently running services, you see &lt;b&gt;a lot&lt;/b&gt; of services that really don’t need to run 24x7.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;What’s Wrong with Services Running 24x7?&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;There are several issues with having services run 24x7:&lt;/p&gt;  &lt;p&gt;First, why have something run (even in the background) when there is no need for it to run? Any running process (services included) uses valuable memory and CPU resources that could be used by other applications and services. If you total up all the services that are running at any given time, they add up to quite a lot of memory, handles, threads, and plenty of CPU usage. All of these “wasted” resources reduce the overall computer performance, decrease its responsiveness, and make users think their computers are sluggish and slow. Also, since most of the running services are configured as Auto-Start (start running upon system log-on), these services have an impact on the computer's boot time.&lt;/p&gt;  &lt;p&gt;Second, these wasted resources, have a direct impact on power consumption. The more demands we place on the CPU, the more power our computer uses. This can be critical for laptops, and could reduce battery life from four hours to three hours.&lt;/p&gt;  &lt;p&gt;Third, having non-productive software run all the time may lead to memory leaks and overall system instability. This can lead to application crashes and ultimately computer crashes.&lt;/p&gt;  &lt;p&gt;Last, but not least, if a service is running 24x7, and this services is well known (any popular application might have one – like the PDF Reader), it provides a larger attack surface. A hacker might use the knowledge that a certain popular application installs a service that runs 24x7, and try to hack into that service to gain privileged access to the computer. &lt;/p&gt;  &lt;p&gt;Given all of the above, it makes you wonder why so many developers configure their services to run all the time when there are other options. Even before Windows 7, there were several service start-up options:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Disabled&lt;/b&gt; completely disables the service and prevents it and its dependencies from running—this means that the user must start the service manually from the Control Panel or the command line&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Manual&lt;/b&gt; starts a service as required (defined by dependencies to other services) or when called from an application using the relevant API as shown later in this post&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Automatic&lt;/b&gt; starts the services at system logon&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Automatic&lt;/b&gt; &lt;b&gt;Delayed&lt;/b&gt; is a newer startup type introduced in Windows Vista that starts the service after the system has finished booting and after initial demanding operations have completed, so that the system boots up faster&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Unfortunately, many ISVs (Microsoft included) still choose to configure their services to Automatic (or Automatic Delayed) because it is the easy solution for everyone. A service simply runs 24x7 and is always available, eliminating the need to check any dependencies or verify that the service is running.&lt;/p&gt;  &lt;p&gt;There are many examples of existing services that can become more resource friendly and more secure by not running 24x7. For example, think of an update service that checks for new application updates. If the computer is not connected to a network and has no IP available, why should the update service run? It can't reach anywhere, so why run a program that does nothing? Think about a policy management service that is invoked when a group policy changes or when the computer joins or leaves a domain, but right now the computer is connected to my home network and again the service works in vain. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Introducing Windows 7 Trigger Start Services&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The solution for the above problems is to move the service out of its “forever running state” into other types of background activity, such as scheduled tasks or trigger-start services. This post focuses on Windows 7 Trigger Start Services. Windows 7 Scheduled Tasks include a lot of valuable information that we will describe in another post. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd405513(VS.85).aspx"&gt;Trigger-start services&lt;/a&gt; are new to Windows7. A trigger-start service is a regular service that you can configure to run (or stop running) only when it is triggered, that is, only when certain criteria and conditions that you define are met (for example, when the first network IP address becomes available, or when the last network IP is lost). Here is a list of the available triggers that you can use to configure the Start-Up mode of a given service:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Device interface arrival or departure&lt;/li&gt;    &lt;li&gt;Joining or leaving a domain&lt;/li&gt;    &lt;li&gt;Opening or closing a firewall port&lt;/li&gt;    &lt;li&gt;Group policy change&lt;/li&gt;    &lt;li&gt;First IP address available/ last IP address leaving&lt;/li&gt;    &lt;li&gt;Custom event – Event Tracing for Windows (ETW)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The last item in the list represents the extendibility point. As a developer, you can configure any ETW event as a trigger for services, which gives you a very good tool to fine-tune your control over starting and stopping services from your application.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;So what exactly is a trigger? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;A trigger consists of:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A trigger event type&lt;/li&gt;    &lt;li&gt;A trigger event subtype&lt;/li&gt;    &lt;li&gt;The action to be taken in response to the trigger event&lt;/li&gt;    &lt;li&gt;One or more trigger-specific data items (for certain trigger event types) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The subtype and the trigger-specific data items together specify the conditions for notifying the service of the event. The format of a data item depends on the trigger event type; a data item can be made up of binary data, a string, or a multistring. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Working with Trigger Start Services&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Unfortunately, Windows 7 Services MMC UI does not include a graphical representation of the trigger start services. However, you have two options. You can still use the old and good sc.exe (Service Configuration command line tool), or you can use the WIN32 &lt;a href="http://msdn.microsoft.com/en-us/library/ms681988(VS.85).aspx"&gt;ChangeServiceConfig2&lt;/a&gt; method to configure the service start option programmatically as demonstrated in this post. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Using &lt;i&gt;SC.exe&lt;/i&gt; to Query Service Trigger Information &lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;It's time to start have some fun. First, let’s start with just extracting some configuration information from a few services. The generic form for using the service configuration is:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;sc &amp;lt;server&amp;gt; [command] [service name] &amp;lt;option1&amp;gt; &amp;lt;option2&amp;gt;...&lt;/pre&gt;
Where &lt;em&gt;server &lt;/em&gt;is optional and by default you work with the local computer:&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;b&gt;command&lt;/b&gt; is the operation you wish to perform like querying trigger information&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;service name &lt;/b&gt;is the name of the service you wish to work with&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;options&lt;/b&gt; are the different values (options) you can pass to configure the service&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s start by querying a specific service for its trigger start configuration. To do so you need to launch a Windows Shell window:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Open the start menu.&lt;/li&gt;

  &lt;li&gt;Type CMD in the search box. &lt;/li&gt;

  &lt;li&gt;Choose cmd.exe.
    &lt;br /&gt;This will open a Windows Shell window.&lt;/li&gt;

  &lt;li&gt;Type &lt;strong&gt;sc qtriggerinfo w32time&lt;/strong&gt; and press enter&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is how it should look:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_64AEB689.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_35E8FDE7.png" width="564" height="141" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;As you can see, we queried the trigger information of the W32time service, which is configured to start when the computer is joined to a domain and stop when the computer leaves the domain.&lt;/p&gt;

&lt;p&gt;Microsoft updated the sc.exe command-line tool for Windows 7 to support configuring and querying a service for supported triggers. Type sc triggerinfo in the Windows shell window and press enter. The result looks like the box below, and lists all the different triggers and how to configure a service to use trigger start services. &lt;/p&gt;

&lt;pre class="csharpcode"&gt;C:\&amp;gt;sc triggerinfo
DESCRIPTION:
        Changes the trigger parameters of a service.
USAGE:
        sc &amp;lt;server&amp;gt; triggerinfo [service name] &amp;lt;option1&amp;gt; &amp;lt;option2&amp;gt;...
OPTIONS:
 start/device/UUID/HwId1/... &amp;lt;Start the service on arrival of the
                             specified device interface class UUID
                             string with one or more hardware ID
                             strings and/or compatible ID strings&amp;gt;
 start/custom/UUID/data0/.. &amp;lt;Start the service on arrival of an
                             event from the specified custom ETW
                             provider UUID string with one or more
                             binary data items as hexadecimal
                             string format such as ABCDABCD to
                             set 4 byte data&amp;gt;
 stop/custom/UUID/data0/... &amp;lt;Stop the service on arrival of an
                             event from the specified custom ETW
                             provider UUID string with one or more
                             binary data items as hexadecimal
                             string format such as ABCDABCD to
                             set 4 byte data&amp;gt;
 start/strcustom/UUID/data0/.. &amp;lt;Start the service on arrival of an
                             event from the specified custom ETW
                             provider UUID string with one or more
                             optional string data items&amp;gt;
 stop/strcustom/UUID/data0/.. &amp;lt;Stop the service on arrival of an
                             event from the specified custom ETW
                             provider UUID string with one or more
                             optional string data items&amp;gt;
 start/networkon             &amp;lt;Start the service on first IP address&amp;gt;
 stop/networkoff             &amp;lt;Stop the service on zero IP addresses&amp;gt;
 start/domainjoin            &amp;lt;Start the service on domain join&amp;gt;
 stop/domainleave            &amp;lt;Stop the service on domain leave&amp;gt;
 delete                      &amp;lt;Delete the existing trigger parameters&amp;gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;For example, to configure a service to start when the first IP address becomes available, all you need to do is type &lt;em&gt;sc triggerinfo [your service name] start/networkon&lt;/em&gt;, where “your service name” is replaced with the name of the service that you wish to configure.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Configuring Trigger Start Services Programmatically Using &lt;i&gt;ChanceServiceConfig2&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The more interesting aspect, from a developer's point of view, is writing services that are trigger aware and using code to configure a service. In Windows 7, you can use the &lt;b&gt;ChangeServiceConfig2&lt;/b&gt; function to configure service trigger information and the &lt;b&gt;QueryServiceConfig2&lt;/b&gt; function to query it. &lt;/p&gt;

&lt;p&gt;Service trigger registration is performed by calling &lt;b&gt;ChangeServiceConfig2&lt;/b&gt;, passing SERVICE_CONFIG_TRIGGER_INFO for the &lt;i&gt;dwInfoLevel&lt;/i&gt; parameter, and providing the trigger registration information in a SERVICE_TRIGGER_INFO structure through the &lt;i&gt;lpInfo&lt;/i&gt; parameter. In addition, one or more trigger-specific data items can be specified. The following is an example of a service installer function that creates a USB device trigger for a service that is named &lt;i&gt;MyService&lt;/i&gt;:&lt;/p&gt;

&lt;div&gt;
  &lt;pre id="codeSnippet" class="csharpcode"&gt;define SERVICE_NAME L&lt;span class="str"&gt;&amp;quot;MyService&amp;quot;&lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;//set the device guid&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; GUID GUID_USBDevice = {&lt;br /&gt;       0x53f56307, 0xb6bf, 0x11d0, &lt;br /&gt;       {0x94, 0xf2, 0x00, 0xa0, 0xc9, &lt;br /&gt;       0x1e, 0xfb, 0x8b }};&lt;br /&gt;&lt;br /&gt;BOOL _SetServiceToStartOnDeviceTrigger()&lt;br /&gt;{&lt;br /&gt;    BOOL fResult = &lt;span class="kwrd"&gt;FALSE&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;    SC_HANDLE hScm = OpenSCManager(&lt;br /&gt;        NULL, &lt;span class="rem"&gt;//local machine&lt;/span&gt;&lt;br /&gt;        NULL, &lt;span class="rem"&gt;//active database&lt;/span&gt;&lt;br /&gt;        SC_MANAGER_CONNECT);&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt;(hScm != NULL)&lt;br /&gt;    {&lt;br /&gt;        SC_HANDLE hService = OpenService(&lt;br /&gt;            hScm,&lt;br /&gt;            SERVICE_NAME,&lt;br /&gt;            SERVICE_ALL_ACCESS);&lt;br /&gt;&lt;br /&gt;        If( hService != NULL)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;           LPCWSTR lpszDeviceString = L&lt;span class="str"&gt;&amp;quot;USBSTOR\\GenDisk&amp;quot;&lt;/span&gt;;&lt;br /&gt;           SERVICE_TRIGGER_SPECIFIC_DATA_ITEM deviceData = {0};&lt;br /&gt;           deviceData.dwDataType = SERVICE_TRIGGER_DATA_TYPE_STRING;&lt;br /&gt;           deviceData.cbData = &lt;br /&gt;                       (wcslen(lpszDeviceString)+1) * &lt;span class="kwrd"&gt;sizeof&lt;/span&gt;(WCHAR);    &lt;br /&gt;           deviceData.pData = (PBYTE)lpszDeviceString;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;           &lt;br /&gt;           SERVICE_TRIGGER st;&lt;br /&gt;           st.dwTriggerType = &lt;br /&gt;                       SERVICE_TRIGGER_TYPE_DEVICE_INTERFACE_ARRIVAL;&lt;br /&gt;           st.dwAction = SERVICE_TRIGGER_ACTION_SERVICE_START;&lt;br /&gt;           st.pTriggerSubtype = (GUID *) &amp;amp;GUID_USBDevice;&lt;br /&gt;           st.cDataItems = 1;&lt;br /&gt;           st.pDataItems = &amp;amp;deviceData;&lt;br /&gt;&lt;br /&gt;           &lt;br /&gt;           SERVICE_TRIGGER_INFO sti;&lt;br /&gt;           sti.cTriggers = 1;&lt;br /&gt;           sti.pTriggers = &amp;amp;st;&lt;br /&gt;           sti.pReserved = 0;&lt;br /&gt;&lt;br /&gt;           fResult = ChangeServiceConfig2(&lt;br /&gt;                        hService,&lt;br /&gt;                        SERVICE_CONFIG_TRIGGER_INFO,&lt;br /&gt;                        &amp;amp;sti);&lt;br /&gt;        }&lt;br /&gt;        CloseServiceHandle (hService);&lt;br /&gt;    }&lt;br /&gt;    CloseServiceHandle (hScm);&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt;(!fResult)&lt;br /&gt;    {&lt;br /&gt;        printf(&lt;span class="str"&gt;&amp;quot;Service trigger registration failed (%d)\n&amp;quot;&lt;/span&gt;, &lt;br /&gt;                 GetLastError());&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; fResult;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;Note: all services are controlled by the Service Control Manager (SCM), which we’ll touch on in a different post.&lt;/div&gt;

&lt;div&gt;
  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;In the above code snippet, you can see that first we get a handle (hScm) to the SCM by calling &lt;i&gt;openSCManager&lt;/i&gt;. Next, we call &lt;i&gt;openService&lt;/i&gt; and pass the handle to the SCM- hscm,and the service name – SERVICE_NAME that we wish access. The last parameter, SERVICE_ALL_ACCESS, indicates that we have complete access to the services. Assuming we got a valid handle to the service, we now start to build the specific structure that we’ll soon use to configure the service. &lt;/p&gt;

&lt;p&gt;SERVICE_TRIGGER_SPECIFIC_DATA_ITEM defines the trigger event type. It contains trigger-specific data for the service trigger event. In our case we define the string that represents a USB gen disk arrival. &lt;/p&gt;

&lt;p&gt;Next we define the SERVICE_TRIGGER structure, which represents a service trigger event. Note that this is where we define the trigger type (device arrival), the action (start the service), and the trigger sub type (the specific family of the USB device). Then we define one device that will trigger the service. Note that you can define an array of devices and their GUIDs. You should also note that we don’t want the service to be triggered upon just any USB device arrival like a mouse or a camera. We want the service to start only when a USB disk arrives. &lt;/p&gt;

&lt;p&gt;Finally, we define the SERVICE_TRIGGER_INFO structure, which contains trigger event information for a service. This structure simply points to the SERVICE_TRIGGER struct that we defined previously, and the number of triggers that, in this case, is one. &lt;/p&gt;

&lt;p&gt;Now we can call the ChanceServiceConfig2 function and pass the handle to the service we wish to configure, a SERVICE_CONFIG_TRIGGER_INFO parameter that indicates that we wish to configure the service trigger, and a null. &lt;/p&gt;

&lt;p&gt;That is all there is to it. If we are successful, then our service will run after we insert a USB hard drive.&lt;/p&gt;

&lt;p&gt;In the next post, we'll review how to write a simple implementation of a .NET service that we’ll program to start upon arrival of a USB generic disk. &lt;/p&gt;

&lt;p&gt;You can learn about Windows 7 using the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1C333F06-FADB-4D93-9C80-402621C600E7&amp;amp;displaylang=en"&gt;Windows 7 Training Kit for Developers&lt;/a&gt; or by viewing Windows 7 videos on &lt;a href="http://channel9.msdn.com/windows"&gt;Channel 9&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also get &lt;a href="http://channel9.msdn.com/learn/courses/Windows7/BackgroundServices/"&gt;hands-on&lt;/a&gt; experience for Windows 7 Trigger Start Services using the &lt;a href="http://channel9.msdn.com/learn/courses/Windows7/"&gt;Windows 7 Online training&lt;/a&gt; that is part of the &lt;a href="http://channel9.msdn.com/learn/"&gt;Channel 9 Learning Center&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=527263" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Channel+9/default.aspx">Channel 9</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Labs/default.aspx">Labs</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Training+Kit/default.aspx">Windows 7 Training Kit</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Triger+Start+Services/default.aspx">Triger Start Services</category></item><item><title>Windows 7 GA – Time for Some New Windows 7 Developer Resources</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/10/22/windows-7-ga-time-for-some-new-windows-7-developer-resources.aspx</link><pubDate>Fri, 23 Oct 2009 00:08:53 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:527063</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=527063</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/10/22/windows-7-ga-time-for-some-new-windows-7-developer-resources.aspx#comments</comments><description>&lt;p&gt;Windows 7 is now available to the public and anyone can buy and install Windows 7, whether for a new computer or an existing one. Soon, people from around the world will run your applications on Windows 7. They will expect the application to work and to feel as though it is a native Windows 7 application that takes advantage of new Windows 7 features and technologies like the Taskbar, libraries, touch, and sensors. &lt;/p&gt;  &lt;p&gt;As Windows 7 approached GA, we continued to release new developer content to help you get up to speed with the new operating system. Now that it's here, Windows 7 GA is a great “excuse” for us to give you a quick update on all the Windows 7 developer content that is available to help you learn how to write a great Windows 7 application. &lt;/p&gt;  &lt;p&gt;Below is a list of locations where you can find Windows 7 developer content.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Updated Windows 7 Training&lt;/b&gt;&lt;b&gt; Kit&lt;/b&gt; – (&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1c333f06-fadb-4d93-9c80-402621c600e7&amp;amp;displaylang=en"&gt;Download it now&lt;/a&gt;)&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="20" width="580"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="290"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1c333f06-fadb-4d93-9c80-402621c600e7&amp;amp;displaylang=en" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_4AF2B9BF.png" width="276" height="256" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="290"&gt;To help you get your application onto Windows 7 as soon as possible, we updated the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1c333f06-fadb-4d93-9c80-402621c600e7&amp;amp;displaylang=en"&gt;&lt;b&gt;Windows 7 Training Kit for Developers&lt;/b&gt;&lt;/a&gt;. You can still find all the previous topics such as Taskbar, Sensor and Location, Libraries and Shell, Multitouch, Ribbon, etc. New to the kit are labs that work with VS2010 and use the new MFC improvements in VS2010 (&lt;a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx"&gt;download VS2010&lt;/a&gt;). We also added VB to all of our managed solutions – truly, no developer is left behind.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Windows 7 Online Training on Channel 9 Learning Center&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Let’s assume you are interested in learning about Windows 7 libraries, or how to add some cool Taskbar functionality to your application, but you don’t want to download the entire training kit. Well with the &lt;a href="http://channel9.msdn.com/learn/courses/Windows7"&gt;Windows 7 Online Training Kit&lt;/a&gt; located on the &lt;a href="http://channel9.msdn.com/learn/"&gt;Channel 9 Learning Center&lt;/a&gt;, you have immediate access to all Windows 7 learning units individually. Each learning unit (like the Taskbar) includes a few hands-on-labs and related videos. This gives you quick and easy access to most of our training material. For the rest of the content, like PowerPoint presentations and additional demos, you will have to &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1c333f06-fadb-4d93-9c80-402621c600e7&amp;amp;displaylang=en"&gt;download the Windows 7 Training Kit for Developers&lt;/a&gt;. The following image shows part of the managed code hands-on-lab for the Taskbar.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://channel9.msdn.com/learn/courses/Windows7" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_42FB175D.png" width="563" height="316" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As always, the Windows 7 Topic Area on Channel 9 still features specific Windows 7 videos and screencasts. Over the past few weeks, we created new videos that I am sure you will find exciting and helpful, including a new Mark Russinovich video. As a friendly reminder, the &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Mark-Russinovich-Inside-Windows-7/"&gt;last video&lt;/a&gt; Mark did, “&lt;a href="http://channel9.msdn.com/shows/Going+Deep/Mark-Russinovich-Inside-Windows-7/"&gt;Mark Russinovich: Inside Windows 7&lt;/a&gt;, was a Channel 9 blockbuster. If you haven't already viewed it, I highly recommend it, and make sure you see Mark’s new video &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Mark-Russinovich-Inside-Windows-7-Redux/"&gt;Mark Russinovich: Inside Windows 7 Redux&lt;/a&gt;. Don’t forget to stay up-to-date with other topics: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://channel9.msdn.com/windows/using/"&gt;Using Windows 7&lt;/a&gt; – Contains consumer- and user-related videos such as how to install Windows 7 and how to set up a home group network &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/windows/programming/"&gt;Programming Windows 7&lt;/a&gt; – I don’t really need to explain what goes here, right? &lt;/li&gt;    &lt;li&gt;Last but not least, “&lt;a href="http://channel9.msdn.com/windows/under-the-hood/"&gt;Under the Hood&lt;/a&gt;” –Covers deep architectural Windows concepts&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;MSDN Developer Center&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://msdn.microsoft.com/en-us/windows/default.aspx"&gt;MSDN Developer Center&lt;/a&gt; also received a “Windows 7 GA refresh” and now sports a new look and much improved functionality. The MSDN Developer Center includes a lot of &lt;a href="http://msdn.microsoft.com/en-us/windows/aa904962.aspx"&gt;Windows 7 material&lt;/a&gt; that extends the training content on available on Channel 9. You can think of the MSDN Developer Center as a hub for the Windows 7 content that will give you a great head start as you develop applications that will shine on Windows 7. You can find information about specific topics, review different programming models, learn about the developer tools that you can use, watch videos, and read blogs.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/windows/aa904962.aspx" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_5AB24EC3.png" width="561" height="433" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;A New Book for Windows 7 Developers&lt;/b&gt;&lt;/p&gt;    &lt;table border="0" cellspacing="0" cellpadding="20" width="557"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="290"&gt;Among the other things that you will find on the MSDN Developer Center, is a list of &lt;a href="http://msdn.microsoft.com/en-us/windows/dd722803.aspx"&gt;recommended Windows 7 &lt;/a&gt;books for developers. It turns out that over the past few months, I’ve been busy writing a Windows 7 book with three amazing co-authors: Laurence Moroney, Sasha Goldshtein, and Alon Fliess. Together, we wrote &lt;i&gt;&lt;a href="http://www.amazon.com/gp/product/0735626820?ie=UTF8&amp;amp;tag=msdn-winc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0735626820"&gt;Introducing Windows 7 for Developers&lt;/a&gt;&lt;/i&gt;. It covers most of the exciting Windows 7 features like the Taskbar, Libraries, Sensor and Location, Multitouch (including new WPF 4 support with VS2010), and even Silverlight out of &lt;/td&gt;        &lt;td valign="top" width="265"&gt;&lt;a href="http://www.amazon.com/gp/product/0735626820?ie=UTF8&amp;amp;tag=msdn-winc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0735626820" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_67AC2ED4.png" width="237" height="285" /&gt;&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;browser (including touch :). As far as I know, this is the first Windows 7 developer book, and I hope you will find it useful. Mark Russinovich found this book helpful while integrating Windows 7 features with the Sysinternals tools and he wrote the foreword for this book.&lt;/p&gt;  &lt;p&gt;I hope this list will help get you on your way to writing amazing Windows 7 applications.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=527063" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows/default.aspx">Windows</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Libraries/default.aspx">Libraries</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Channel+9/default.aspx">Channel 9</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Labs/default.aspx">Labs</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Training+Kit/default.aspx">Windows 7 Training Kit</category></item><item><title>Windows 7 Labs @ PDC</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/10/16/windows-7-labs-pdc.aspx</link><pubDate>Fri, 16 Oct 2009 16:46:14 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:526600</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=526600</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/10/16/windows-7-labs-pdc.aspx#comments</comments><description>&lt;p&gt;PDC 2009 takes place at the LA Convention Center on November 17&lt;sup&gt;th&lt;/sup&gt;, 18&lt;sup&gt;th&lt;/sup&gt;, and 19&lt;sup&gt;th&lt;/sup&gt;. As I wrote &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/10/08/windows-7-at-pdc09.aspx"&gt;before&lt;/a&gt;, The Professional Developers Conference is the one event each developer has to attend. Windows 7 will become generally available (GA) to the public on October 22nd. With the pre-release veil of secrecy lifted, during this year's PDC we can dive deep (very deep) into Windows 7 to extend our understanding of how Windows 7 works and, even more importantly, how developers can take advantage of all the great new improvements and features Windows 7 has to offer.&lt;/p&gt;  &lt;p&gt;Just in case you missed my previous announcement, there is a &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/10/07/free-windows-7-seminar-with-mark-russinovich-and-friends.aspx"&gt;FREE Windows 7 (seminar) Boot Camp&lt;/a&gt; led by top Microsoft Windows experts like &lt;a href="http://www.microsoft.com/presspass/exec/techfellow/Russinovich/default.mspx"&gt;Mark Russinovich&lt;/a&gt;, &lt;a href="http://www.microsoft.com/presspass/exec/de/Wang/default.mspx"&gt;Landy Wang&lt;/a&gt;, and Arun Kishan. Then, during the PDC proper, we’ll have &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/10/08/windows-7-at-pdc09.aspx"&gt;several deep-dive Windows 7 sessions&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;During this year's PDC, we’ll host the &lt;strong&gt;Windows 7 Developer Center&lt;/strong&gt;. The Windows 7 Developer Center gives you the opportunity to test your application on Windows 7, identify and solve problems with a group of consultants, and eventually get your application Logo-certified. Applications can be loaded onto a secure Windows 7 test platform in a private developer lab environment for Logo testing and submission. Our Windows Applications Developer Consultants can also help with Windows Compatibility questions or offer specific guidance for how you can make your application shine on Windows 7. You can pre-book a time slot right away, book a time when you get to the PDC, or just stop by Room 504/505. And guess what? It is all free; all you need to do is register. &lt;i&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Registration&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;You can pre-register for a 1-hour timeslot in the lab as outlined below. You can also register upon arrival at PDC09 by signing up at the reception station located in &lt;b&gt;Room 504/505&lt;/b&gt;, or just stop by to talk about developing applications for Windows 7.&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;         &lt;p&gt;&lt;b&gt;Monday 11/16&lt;/b&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;10:00 am&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;11:00 am&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;1:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;2:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;3:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;4:00 pm&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;         &lt;p&gt;&lt;b&gt;Tuesday 11/17&lt;/b&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;11:00 am&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;1:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;2:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;3:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;4:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;5:00 pm&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;         &lt;p&gt;&lt;b&gt;Wednesday 11/18&lt;/b&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;11:00 am&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;1:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;2:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;3:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;4:00 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;5:00 pm&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;         &lt;p&gt;&lt;b&gt;Thursday 11/19&lt;/b&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;8:30 am&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;9:30 am&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;10:30 am&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;11:30 am&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;1:30 pm&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;2:30 pm&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Getting Started&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Logo Test&lt;/b&gt; - To help maximize your time in the lab at PDC, we are asking that you run the Logo test and submit the .xml result report to our team for review prior to the event. Our consultants will analyze your results and prepare a report to review with you on-site at PDC.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;VeriSign &amp;amp; WinQual IDs&lt;/b&gt; – In order to submit your product for Windows 7 Logo, you will need to obtain both of these credentials. Once obtained, you will be able to work directly with a Microsoft consultant through the submission process while on-site at PDC. (More info here - &lt;a href="https://winqual.microsoft.com/"&gt;https://winqual.microsoft.com/&lt;/a&gt;.)&lt;/p&gt;  &lt;p&gt;Follow these simple steps to register and prepare for PDC 2009:&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1. Email &lt;a href="mailto:srglabs@microsoft.com"&gt;srglabs@microsoft.com&lt;/a&gt; with &lt;strong&gt;3&lt;/strong&gt; timeslots in order of preference from those listed above.&lt;/p&gt;  &lt;p&gt;2. Download the Logo toolkit from &lt;a href="https://connect.microsoft.com/site/sitehome.aspx?SiteID=831"&gt;MS Connect&lt;/a&gt; and follow the instructions for testing.&lt;/p&gt;  &lt;p&gt;3. Send the .xml result report generated by the Logo toolkit to &lt;a href="mailto:srglabs@microsoft.com"&gt;srglabs@microsoft.com&lt;/a&gt; for analysis.&lt;/p&gt;  &lt;p&gt;4. Sign up for VeriSign &amp;amp; WinQual IDs that will be required for Logo submission by visiting &lt;a href="https://winqual.microsoft.com/"&gt;https://winqual.microsoft.com/&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Additional Resources&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;• For general questions contact &lt;a href="mailto:srglabs@microsoft.com"&gt;srglabs@microsoft.com&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;• For questions and more details about the Windows 7 Logo Program visit &lt;a href="https://connect.microsoft.com/site/sitehome.aspx?SiteID=831"&gt;MS Connect&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This is a great opportunity to prepare your applications for Windows 7, but there is limited availability so be sure to register early to get your preferred time slot.&lt;/p&gt;  &lt;p&gt;You can learn about Windows 7 using the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1C333F06-FADB-4D93-9C80-402621C600E7&amp;amp;displaylang=en"&gt;Windows 7 Training Kit for Developers&lt;/a&gt; or by viewing Windows 7 videos on &lt;a href="http://channel9.msdn.com/windows"&gt;Channel 9&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=526600" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows/default.aspx">Windows</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Channel+9/default.aspx">Channel 9</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Labs/default.aspx">Labs</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Training+Kit/default.aspx">Windows 7 Training Kit</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/PDC/default.aspx">PDC</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Professional+Developers+Conference/default.aspx">Professional Developers Conference</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/PDC2009/default.aspx">PDC2009</category></item><item><title>Windows 7 At PDC09</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/10/08/windows-7-at-pdc09.aspx</link><pubDate>Thu, 08 Oct 2009 17:08:26 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:526314</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>18</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=526314</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/10/08/windows-7-at-pdc09.aspx#comments</comments><description>&lt;p&gt;The Professional Developers Conference (PDC) is the one event that all developers who use any Microsoft technologies must attend at least once in their professional careers. It’s the flagship event for developers, offering the most comprehensive, future-looking, technically deep, densely-packed set of sessions from Microsoft speakers you can find anywhere. This &lt;a href="http://microsoftpdc.com/"&gt;year’s PDC&lt;/a&gt; is no exception and you can expect it to be a very exciting event.&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="20" width="556"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="419"&gt;         &lt;p&gt;My first PDC was PDC08, held last November at the LA Convention Center. As one of the people at Microsoft who work on Windows 7, I was fortunate enough to be in the loop regarding Windows 7 @ PDC08, and was able to contribute (even if only in a small way) to one of the keynote. During the Day 2 keynote, &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="135"&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_0410E73D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_554B2E9A.png" width="140" height="87" /&gt;&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Steven Sinofsky presented Windows 7 to the world and for the first time people outside of Microsoft saw the new Taskbar, the Windows Ribbon, and witnessed a live multitouch demo. Attendees received a 160G hard drive (makes you wonder what they'll get this year…) with Windows 7 build 6800 (does anyone remember this build number?). The Windows team presented a lot of its technologies in a series of impressive sessions. And since then, through the different versions of Windows--Beta, RC, and RTM--we continued to push new content to help developers ramp up and get ready for Windows 7.&lt;/p&gt;  &lt;p&gt;Windows 7 will become “Generally Available” (GA) to the public on October 22&lt;sup&gt;nd&lt;/sup&gt;, exactly two weeks from today, and this year’s PDC takes place right after Windows 7 GA. With the pre-release veil of secrecy lifted, during this year's PDC we can dive deep (very deep) into Windows 7 to extend our understanding of how Windows 7 works and, even more importantly, how developers can take advantage of all the great new improvements and features Windows 7 has to offer. &lt;/p&gt;  &lt;p&gt;To start with, on the day before PDC09 starts, there is a &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/10/07/free-windows-7-seminar-with-mark-russinovich-and-friends.aspx"&gt;FREE Windows 7 (seminar) Boot Camp&lt;/a&gt; led by top Microsoft Windows experts like Mark Russinovich, Landy Wang, and Arun Kishan. Then, during the PDC proper, we’ll have several deep-dive Windows 7 sessions.&lt;/p&gt;  &lt;p&gt;So here is the first set of Windows 7 sessions that we are announcing:&lt;/p&gt;  &lt;p&gt;This first one is probably my favorite topic (I am a geek, what can I say). What could be more important than performance, especially as it relates to Windows 7 and applications running on Windows 7? This has to be a MUST Attend session for any developer who writes any software (native or .NET) for &lt;b&gt;Windows&lt;/b&gt; (and not just Windows 7) – this is truly a unique opportunity.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Optimizing for Performance with the Windows Performance Toolkit&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The Windows team uses the Windows Performance Toolkit (WPT) to optimize the Windows OS. Come and see how the Windows Performance team used the WPT throughout the Windows 7 development cycle to optimize for customer scenarios and how you can leverage many of its features and capabilities to help you build faster applications on Windows. This session will present case studies that demonstrate how you can use the toolkit to pinpoint areas for improvement in your application and provide you with some best practices to follow in order to create applications with optimum performance.&lt;/p&gt;  &lt;p&gt;The next two sessions are also personal favorites (you can’t blame me for loving Windows 7), as I think these technologies represent new levels of user interaction and adaptive user interfaces:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Building Sensor- and Location-aware Applications with Windows 7 and .NET&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;How many times have you thought to yourself, “My application would be so much better if it knew where the user was?” With Windows 7 and.NET Framework 4.0, you now have the tools at your fingertips to location-enable your applications. Based on the new Location platform for Windows 7, the location API in .NET Framework 4.0 provides a single, consistent API to get you your latitude and longitude regardless of the underlying technology that acquired it—allowing you to focus on creating exciting, differentiated location-aware applications.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Windows Touch Deep Dive&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Windows provides applications with a default experience for gestures and touch interaction. This provides applications that you want to go beyond that basic experience with a powerful platform to build upon. This session is targeted at developers interested in building touch-optimized experiences. We’ll look closely at some of the more powerful portions of the Touch platform, like manipulation and inertia processors, as well as cover real-world problems that developers have encountered and overcome. Come help build the next generation of user experiences!&lt;/p&gt;  &lt;p&gt;Another highly recommended session is the Windows Ribbon session. Before you dismiss the Ribbon, I suggest you take a second look and read between the lines of the Windows Ribbon native API. There is a lot of very interesting software architecture in the current API that provides a glimpse into tomorrow’s “commanding framework.”&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Windows Ribbon Technical Deep Dive&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This talk will cover some of the more subtle and complex aspects of ribbon implementation, like designing a great gallery (a critical task for any ribbon), adding an outspace MRU, etc. We will draw from specific experiences with Windows Live and other partners and spread the learning that those teams amassed as Windows Ribbon guinea pigs.&lt;/p&gt;  &lt;p&gt;A lot has been said about the update to the Windows 7 graphics stack. This stack plays a major role in the performance improvements Windows 7 offers. You, as a developer, can tap into that user experience and start enjoying a rich and modern graphic framework that pushes GPUs to their limits.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Modern 3D Graphics Using Windows 7 &amp;amp; Direct3D 11 Hardware&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Dig deep into the capabilities of Direct3D 11 and Windows 7to gain practical knowledge that will help you push graphics to the limit. Learn about the new tessellation stage in Direct3D 11, which enables an unprecedented level of rendering quality by dynamically generating geometry on the GPU. In addition, see how the multi-core improvements in the Direct3D 11 runtime can help you scale your application to take full advantage of all of the cores on a machine. Finally, take a peek at the power of DirectCompute (the hardware-accelerated general purpose computing technology) in a graphics application context.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Advanced Graphics Functionality Using DirectX&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The number of PC configurations is exploding. With both netbooks and high-end desktop systems using the latest in graphics hardware, creating an application that can target all of these systems is getting harder every year. Join us as we explore the many options available in Windows 7 to facilitate graphics development across all kinds of hardware configurations, from low-end integrated GPUs to top of the line discrete GPUs. Learn about Direct3D 10 Level 9, which enables Direct3D 10 applications to run on pretty much every computer in the market today. Check out WARP, our new software rasterizer that lets your application use high-quality graphics even when there’s no graphics card. Finally, learn about Direct2D, DirectWrite, WIC, and the interoperability of Windows 7 technologies for making slick, high-quality graphics for your applications of the future.&lt;/p&gt;  &lt;p&gt;The last session for today’s post, but most certainly not the least, is about the &lt;a href="http://code.msdn.microsoft.com/WindowsAPICodePack"&gt;Windows API Code Pack for the Microsoft .NET framework&lt;/a&gt;. This is a framework that I have a personal interest in and I often blog about. With Visual Studio 2010 and .NET 4, .NET developers have an easier life. Nonetheless, there are still a great number of valuable Windows APIs that are NOT in the framework. This Open Source library provides a good intermediate solution.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Developing with the Windows API Code Pack for .NET Framework&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The Windows API Code Pack for Microsoft .NET Framework provides a source code library that you can use to access some new Windows 7 features (and some existing features of older versions of the Windows operating system) from managed code. These Windows features are not available to developers today in the .NET Framework. This session will show you how to access features like taskbar integration, JumpLists, libraries, the sensor platform, Direct2D, and more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=526314" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows/default.aspx">Windows</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Multi-Touch/default.aspx">Multi-Touch</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sensor+and+Location/default.aspx">Sensor and Location</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Libraries/default.aspx">Libraries</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Application+Compatibility/default.aspx">Windows 7 Application Compatibility</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Training+Kit/default.aspx">Windows 7 Training Kit</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/PDC09/default.aspx">PDC09</category></item><item><title>Free Windows 7 Seminar with Mark Russinovich (and Friends)</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/10/07/free-windows-7-seminar-with-mark-russinovich-and-friends.aspx</link><pubDate>Wed, 07 Oct 2009 19:17:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:526269</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>30</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=526269</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/10/07/free-windows-7-seminar-with-mark-russinovich-and-friends.aspx#comments</comments><description>&lt;p&gt;Have you ever wondered how Windows 7 resumes from sleep in less than 2 seconds? Or how Windows 7 can scale up to 256 cores? Or maybe you just want to want to learn about any Kernel improvements that will make your application run faster with no extra effort from you? &lt;/p&gt;
&lt;p align="left"&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/PDC_5F00_Win_5F00_bootcamp_5F00_5E9DE442.jpg"&gt;&lt;img height="240" width="191" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/PDC_5F00_Win_5F00_bootcamp_5F00_thumb_5F00_4BE8EA8B.jpg" alt="PDC_Win_bootcamp" border="0" title="PDC_Win_bootcamp" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;Well, guess what? On Monday, November 16&lt;sup&gt;th&lt;/sup&gt;, the day before &lt;a href="http://microsoftpdc.com/"&gt;PDC 2009&lt;/a&gt; starts, we are running a &lt;b&gt;FREE&lt;/b&gt; Windows 7 Workshop&lt;b&gt; &lt;/b&gt;&amp;ndash;&lt;b&gt; &lt;/b&gt;AKA &lt;a href="http://microsoftpdc.com/Sessions/WKSP08"&gt;&lt;b&gt;Windows 7 Developer Boot Camp&lt;/b&gt;&lt;/a&gt;. That is&amp;nbsp; right, it's &lt;b&gt;FREE&lt;/b&gt; for anyone who wants to attend. Windows 7 is one of the most exciting pivotal releases of the year. As part of the wave of activity surrounding the product launch, we're opening up this workshop to &lt;b&gt;anyone&lt;/b&gt; who wants to attend - even if &lt;b&gt;you're not&lt;/b&gt; able to join the rest of the conference. So, if you live LA, its surroundings, or even the Bay Area, you can attend this workshop for FREE!&lt;/p&gt;
&lt;p&gt;Wait a minute! By now, you must be thinking to yourself, &amp;ldquo;If it is free, it can&amp;rsquo;t be that good.&amp;rdquo; Well it turns out that this Windows 7 Developers Boot Camp will include top Microsoft Windows experts like &lt;a href="http://www.microsoft.com/presspass/exec/techfellow/Russinovich/default.mspx"&gt;Mark Russinovich&lt;/a&gt;, &lt;a href="http://www.microsoft.com/presspass/exec/de/Wang/default.mspx"&gt;Landy Wang&lt;/a&gt;, and Arun Kishan. These are the guys who are behind a large number of the amazing performance improvements in Windows 7, and this is your onetime chance to meet them in person for an intense, deep, and high-quality session. Mark, Landy, and Arun will start by talking about Kernel and architectural improvements, for example, the &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Arun-Kishan-Farewell-to-the-Windows-Kernel-Dispatcher-Lock/"&gt;Kernel Dispatcher Lock&lt;/a&gt;, new and even more efficient &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Landy-Wang-Windows-Memory-Manager/"&gt;Windows Memory Management&lt;/a&gt;, and &lt;a href="http://channel9.msdn.com/posts/philpenn/Trigger-Started-Services/"&gt;Trigger Start Services&lt;/a&gt;, among many other topics. &lt;/p&gt;
&lt;p&gt;Next, they&amp;rsquo;ll take a dive deep into the different APIs, paying special attention to the new shell integration points in Windows 7 such as the taskbar, libraries, and search. Right after that, they&amp;rsquo;ll give some tips for getting the most out of today&amp;rsquo;s hardware using the Sensor &amp;amp; Location platform, multitouch, and the new graphics libraries (Direct2D, DirectX 11) that take advantage of the GPU. &lt;/p&gt;
&lt;p&gt;Regardless of whether you&amp;rsquo;re a C++, C#, or Visual Basic developer, if you're building a Windows application and you want your application to have the best possible performance, experience, and look-and-feel while running on Windows 7, this event is for you! I know I will be there; what about you?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://microsoftpdc.com/Workshops"&gt;Register for the PDC Workshop&lt;/a&gt; or read more info about the &lt;a href="http://microsoftpdc.com/Sessions/WKSP08"&gt;Windows 7 Boot Camp&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=526269" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Multi-Touch/default.aspx">Multi-Touch</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sensor+and+Location/default.aspx">Sensor and Location</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Libraries/default.aspx">Libraries</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Application+Compatibility/default.aspx">Windows 7 Application Compatibility</category></item><item><title>Windows 7 RTM – Go Get It</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/08/06/windows-7-rtm-go-get-it.aspx</link><pubDate>Thu, 06 Aug 2009 22:36:48 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:522353</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>42</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=522353</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/08/06/windows-7-rtm-go-get-it.aspx#comments</comments><description>&lt;p&gt;This is it people. Windows 7 RTM is available for download from &lt;a href="http://msdn.microsoft.com"&gt;MSDN&lt;/a&gt; &amp;amp; &lt;a href="http://technet.microsoft.com"&gt;TechNet&lt;/a&gt; sites! If you have a MSDN subscription you can get Windows 7 RTM in English. On October 1st, the remaining languages will be released, for more information read - &lt;a href="http://windowsteamblog.com/blogs/windows7/archive/2009/08/06/windows-7-rtm-available-today-for-msdn-amp-technet-subscribers.aspx"&gt;Windows 7 RTM Available Today for MSDN &amp;amp; TechNet Subscribers&lt;/a&gt;. You can also get the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=71deb800-c591-4f97-a900-bea146e4fae1&amp;amp;displaylang=en" target="_blank"&gt;Windows 7 SDK&lt;/a&gt;&amp;#160; and the RTM version of the &lt;a href="http://code.msdn.microsoft.com/WindowsAPICodePack"&gt;Windows API Code Pack for .NET Framework&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Make sure you get them all today to start testing your applications, and to make sure &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/07/23/is-your-application-ready-for-windows-7-rtm.aspx"&gt;your applications are ready for Windows 7 RTM&lt;/a&gt;! Now is the time to work on your applications to make sure they are Windows 7 compatible. On top of that, you can use new Windows 7 features such as the Sensor and Location Platform, Taskbar, Libraries, Multi-Touch, the new Graphics APIs, the Windows Ribbon, and many other important and exciting Windows 7 technologies to make your application shine on Windows 7.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;New Windows 7 Training Kit for Developers - Get it NOW!&lt;/strong&gt;&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="20" width="580"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="206"&gt;To help you get your application on Windows 7 as soon as possible, we updated the &lt;strong&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1c333f06-fadb-4d93-9c80-402621c600e7&amp;amp;displaylang=en" target="_blank"&gt;Windows 7 Training Kit for Developers&lt;/a&gt;&lt;/strong&gt; for the RTM version and gave it a new look and better functionality. You can still find all existing topics such as: Taskbar, Sensor and Location, Libraries and Shell, DirectX, Multi-touch, Ribbon, etc. No dev was left behind! The kit is built for both native Win32 &lt;/td&gt;        &lt;td valign="top" width="374"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1c333f06-fadb-4d93-9c80-402621c600e7&amp;amp;displaylang=en"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Windows7TrainingKit" border="0" alt="Windows7TrainingKit" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/Windows7TrainingKit_5F00_18500CB9.png" width="389" height="314" /&gt;&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;C++ developers and .NET developers, so now most topics have multiple labs.We also added 6 new Application Compatibility labs: Version Checking, Data Redirection, UIPI, Installer Detection, Session 0 Isolation, and High DPI, to help you get over the most common application compatibility issues. All the topics in the training kit include additional information like whitepapers, links to MSDN, and links to &lt;strong&gt;videos from Channel 9&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;strong&gt;Updated Windows Topic Area on Channel 9&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;We also gave the &lt;a href="http://channel9.msdn.com/windows/"&gt;Windows topic area on Channel 9&lt;/a&gt; a brand new look and functionality to help you to better choose the right Windows 7 content you need. In the new Windows topic area for Channel 9, you can choose from three main topic areas:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://channel9.msdn.com/windows/using/"&gt;Using Windows 7&lt;/a&gt; – Contains consumer- and user-related videos such as how to install Windows 7 and how to set up a home group network &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/windows/programming/"&gt;Programming Windows 7&lt;/a&gt; – I don’t really need to explain what goes here, right? &lt;/li&gt;    &lt;li&gt;Last but not least, “&lt;a href="http://channel9.msdn.com/windows/under-the-hood/"&gt;Under the Hood&lt;/a&gt;” – Contains classics like the &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Mark-Russinovich-Inside-Windows-7/"&gt;interview with Mark Russinovich&lt;/a&gt; on Windows 7 Internals. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://channel9.msdn.com/windows/"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="NewC9" border="0" alt="NewC9" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/NewC9_5F00_3189E47C.png" width="549" height="414" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;While we hope you find all this helpful, this is only the start! We are working on more new and exciting content that will be shipped in the following weeks, so stay tuned.&lt;/p&gt;  &lt;p&gt;In the meantime, here is some additional useful information:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The &lt;a href="http://msdn.microsoft.com/en-us/windows/default.aspx"&gt;Windows page&lt;/a&gt; on MSDN is the one-stop shop for Windows client developers &lt;/li&gt;    &lt;li&gt;At &lt;a href="http://msdn.microsoft.com/en-us/windows/dd433113.aspx"&gt;Develop for Windows 7&lt;/a&gt;, you can find all the information you need about specific technologies like Direct2D, Taskbar, Sensor and Location, Power Shell 2, Windows Ribbon, and many more &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/windows/dd433113.aspx"&gt;Windows Application Compatibility&lt;/a&gt; is the one page you want to visit to make sure your application runs properly on Windows 7; it includes content and tools to test and fix many application compatibility issues. Directly accessible from that page, is the &lt;a href="http://msdn.microsoft.com/library/dd371778(VS.85).aspx"&gt;Windows 7 Application Quality Cookbook&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Also still very relevant, is the &lt;a href="http://msdn.microsoft.com/en-us/library/bb757005.aspx"&gt;Windows Vista Application Compatibility Cookbook&lt;/a&gt;--most Windows 7 compatibility issues are the direct result of the changes introduced in the Windows Vista timeframe, and are included as topics in this Cookbook (UAC, Session 0 Service Isolation, IE Protected Mode, etc.), which is a great starting point for addressing these issues &lt;/li&gt;    &lt;li&gt;New Windows 7 videos on the &lt;a href="http://channel9.msdn.com/windows"&gt;Channel 9 Windows &lt;/a&gt;page explore specific features and technologies, and are great “windows” to the Windows engineering team &lt;/li&gt;    &lt;li&gt;As always, the &lt;a href="http://blogs.msdn.com/e7"&gt;E7 blog&lt;/a&gt; is an amazing source of the engineering back story behind Windows 7 &lt;/li&gt;    &lt;li&gt;Last, but not least, for IT-Pro, we have our &lt;a href="http://technet.microsoft.com/en-us/windows/dd361745.aspx"&gt;SPRINGBOARD SERIES&lt;/a&gt;, and &lt;a href="http://edge.technet.com/windows/" target="_blank"&gt;edge on TechNet&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;And, of course, continue to watch for new posts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=522353" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sample+Code/default.aspx">Sample Code</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Application+Compatibility/default.aspx">Windows 7 Application Compatibility</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Channel+9/default.aspx">Channel 9</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Labs/default.aspx">Labs</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Training+Kit/default.aspx">Windows 7 Training Kit</category></item><item><title>Version Checking (Just Don’t Do It)</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/08/05/version-checking-just-don-t-do-it.aspx</link><pubDate>Wed, 05 Aug 2009 22:55:33 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:522166</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>17</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=522166</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/08/05/version-checking-just-don-t-do-it.aspx#comments</comments><description>&lt;p&gt;Version checking is probably one of the most common Application Compatibility issues that both developers and users are facing. This is another post in a series of posts about &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/07/23/is-your-application-ready-for-windows-7-rtm.aspx" target="_blank"&gt;Getting Ready for Windows 7&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;As said, this is probably the most common application compatibility issue that users as well as developers face is when an application fails upon checking the operating system version. A lot can go wrong when version checking is misused. A user might experience a “silent fail” where the application simply fails to load and nothing happens. Or, a user might see a dialog box indicating something to the effect of “you must be running Microsoft Windows XP or later” when in fact, the computer is running Windows 7. Many other consequences to poor version checking can inconvenience users as well. &lt;/p&gt;  &lt;p&gt;Applications fail due to version checking for two main reasons:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A flaw (bug) in the version checking code, which fails if the minor version is decreased, even if the major version is increased, for example, changing versions from 5.1(Windows XP) to 6.0 (Windows Vista), or if the expected service pack (SP) is not installed, even if you're running a newer operating system (for example, changing versions from Windows XP SP 2 to Windows Vista SP 1). We recommend that you check functionality rather then checking version, as you can read in this post. &lt;/li&gt;    &lt;li&gt;An intentional blocking that prevents the application from running on operating system versions not tested by its developers. We recommend that you &lt;strong&gt;do not &lt;/strong&gt;block applications from running on future operating systems. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;When an application runs on an &amp;quot;incompatible&amp;quot; (due to poor version checking) version of Windows, it will generally display an error message, but it may also exit silently or behave erratically. Often, if we work around the version checking, the application will run well. End-users and IT professionals may apply a fix to let the application think it is running on an older version of Windows.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Working Around The Problem (not really solving the bug)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Compatibility mode:&lt;/b&gt; Designed for &lt;strong&gt;end users&lt;/strong&gt; (not for developers to not fix their bugs), compatibility mode is an easy way to work around compatibility issues. When enabled, it applies a set of compatibility fixes that provide a runtime environment more compatible with applications written for older versions of Windows. One of those fixes is the &amp;quot;version lie,&amp;quot; which makes the version query functions return the operating system version the user chose in the &lt;b&gt;Compatibility&lt;/b&gt; tab of the &lt;b&gt;Properties&lt;/b&gt; dialog box instead of the actual Windows version.&lt;/p&gt;  &lt;p&gt;To enable compatibility mode:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Right-click the executable or shortcut to the executable. &lt;/li&gt;    &lt;li&gt;Click &lt;b&gt;Properties&lt;/b&gt;. &lt;/li&gt;    &lt;li&gt;Click the &lt;b&gt;Compatibility&lt;/b&gt; tab. &lt;/li&gt;    &lt;li&gt;Enable &lt;b&gt;Run this program in compatibility mode for:&lt;/b&gt; and select the operating system version you think the application should be able to run on.       &lt;br /&gt;Some applications consist of several executables. You may need to apply this fix to each one. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_14A7A765.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_53992800.png" width="251" height="341" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Click OK to close the dialog box. &lt;/li&gt;    &lt;li&gt;Run the application. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Checking for Features Rather Than Version&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;As mentioned previously, checking the operating system version is not the best way to confirm that a specific operating system feature is available. This is because the operating system may have had new features added in a redistributable DLL. Rather than using GetVersionEx to determine the operating system platform or version number, it is more effective to test for the presence of the feature itself. For example, we plan to make the Direct2D and DirectWrite APIs and the Ribbon API available in Windows Vista, so there is no need to block your application from using these APIs when running on Windows Vista. You just need to check if these features are available on the Operation System that you are running. If possible, your application should still run if the feature is unavailable, though with reduced functionality or performance.&lt;/p&gt;  &lt;p&gt;You can use one of the following techniques to find out if a specific features is available on the given OS.&lt;/p&gt;  &lt;p&gt;For Win32 developers:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Use &lt;b&gt;LoadLibrary&lt;/b&gt;() to load a library which is not yet loaded into your application. If you are interested in a new function of a DLL which is already loaded (for example, kernel32.dll), then call &lt;b&gt;GetModuleHandle&lt;/b&gt;() to obtain the module handle. If either of these functions return NULL, then this indicates an error. &lt;/li&gt;    &lt;li&gt;Use &lt;b&gt;GetProcAddress&lt;/b&gt;() to obtain a function pointer. If &lt;b&gt;GetProcAddress()&lt;/b&gt; returns NULL, then the function may not exist. Cast the pointer to a function pointer of an appropriate prototype. Some functions, although they exist may actually be stubs that return a &amp;quot;not implemented&amp;quot; error. Be such to check for such errors. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Windows 7 introduces a new timer API - SetWaitableTimerEXProc, which adds one more input variable to the regular SetWaitableTimerProc. The TolerableDelay lets you specific a time tolerance window in which the timer can expire. This is a new in Windows 7, that we will use to demonstrate how to check for feature.&lt;/p&gt;  &lt;pre class="code"&gt;      &lt;span style="color: green"&gt;// define function pointer type
    &lt;/span&gt;&lt;span style="color: blue"&gt;typedef &lt;/span&gt;BOOL (WINAPI *SetWaitableTimerExProc)(
      __in  HANDLE hTimer,
      __in  &lt;span style="color: blue"&gt;const &lt;/span&gt;LARGE_INTEGER *lpDueTime,
      __in  LONG lPeriod,
      __in  PTIMERAPCROUTINE pfnCompletionRoutine,
      __in  LPVOID lpArgToCompletionRoutine,
      __in  PREASON_CONTEXT WakeContext,
      __in  ULONG TolerableDelay
    );

    LARGE_INTEGER liDueTime;
    liDueTime.QuadPart = 0;
    nt period = 1000;
    &lt;span style="color: blue"&gt;unsigned int &lt;/span&gt;tolerance = 1000;
    HANDLE hTimer = &lt;span style="color: green"&gt;// Get timer handle

    &lt;/span&gt;REASON_CONTEXT reasonContext = {0};
    reasonContext.Version = 0;
    reasonContext.Flags = POWER_REQUEST_CONTEXT_SIMPLE_STRING;
    reasonContext.Reason.SimpleReasonString = L&lt;span style="color: #a31515"&gt;&amp;quot;MyTimer&amp;quot;&lt;/span&gt;;

    &lt;span style="color: green"&gt;// Get module handle to a module which is already loaded
    &lt;/span&gt;HMODULE hKernel32Module = GetModuleHandle(_T(&lt;span style="color: #a31515"&gt;&amp;quot;kernel32.dll&amp;quot;&lt;/span&gt;));
    &lt;span style="color: blue"&gt;if &lt;/span&gt;(hKernel32Module == NULL)
        &lt;span style="color: blue"&gt;return &lt;/span&gt;FALSE;

    &lt;span style="color: green"&gt;// Get Address of function
    &lt;/span&gt;SetWaitableTimerExProc pFnSetWaitableTimerEx =
    (SetWaitableTimerExProc) ::GetProcAddress(hKernel32Module,     
        &lt;span style="color: #a31515"&gt;&amp;quot;SetWaitableTimerEx&amp;quot;&lt;/span&gt;);

    &lt;span style="color: green"&gt;// Check if the function exists    
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(pFnSetWaitableTimerEx == NULL)
        &lt;span style="color: blue"&gt;return &lt;/span&gt;FALSE;

    &lt;span style="color: green"&gt;// Call function
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(!pFnSetWaitableTimerEx(hTimer, &amp;amp;liDueTime, period, NULL, NULL,
            &amp;amp;reasonContext, tolerance)
    { &lt;span style="color: green"&gt;// handle error }

&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, you may use DLL delayed loading and call functions in a __try...__except block. (For more information, see &lt;a href="http://msdn.microsoft.com/en-us/library/151kt790.aspx"&gt;Linker Support for Delay-Loaded DLLs&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;For COM APIs, handle errors returned by &lt;b&gt;CoCreateInstance&lt;/b&gt; and &lt;b&gt;QueryInterface&lt;/b&gt;.NET framework applications that call Win32 APIs via &lt;b&gt;P/Invoke&lt;/b&gt; should handle &lt;b&gt;EntryPointNotFoundException&lt;/b&gt; and &lt;b&gt;DllNotFoundException&lt;/b&gt; exceptions.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If You Must Check OS Version Number&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Identifying the current operating system is not the best way to determine whether a particular operating system feature is present. However, if you can’t design your application to check for specific feature availability and the only way to ensure compatibility is through version checking, &lt;i&gt;then please consider the following&lt;/i&gt;.&lt;/p&gt;

&lt;p&gt;For native applications, you will need to ensure your application's logic will work with newer versions of Windows. Please &lt;strong&gt;DO NOT BLOCK &lt;/strong&gt;on version change! The following is a Win32 code example that uses &lt;b&gt;GetVersionEx&lt;/b&gt;. If the major version is greater than 5 (Windows Vista, Windows® Server 2008 R2 and Windows 7), the check passes. If it equals 5, then the minor version should be 1 or greater (Windows XP or Windows Server 2003).&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;#include &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;windows.h&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;#include &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;stdio.h&amp;gt;

&lt;/span&gt;&lt;span style="color: blue"&gt;void &lt;/span&gt;main()
{
    OSVERSIONINFO osvi;
    BOOL bIsWindowsXPorLater;

    ZeroMemory(&amp;amp;osvi, &lt;span style="color: blue"&gt;sizeof&lt;/span&gt;(OSVERSIONINFO));
    osvi.dwOSVersionInfoSize = &lt;span style="color: blue"&gt;sizeof&lt;/span&gt;(OSVERSIONINFO);

    GetVersionEx(&amp;amp;osvi);

    bIsWindowsXPorLater = 
 ( (osvi.dwMajorVersion &amp;gt; 5) ||
       ( (osvi.dwMajorVersion == 5) &amp;amp;&amp;amp; (osvi.dwMinorVersion &amp;gt;= 1) ));

    &lt;span style="color: blue"&gt;if&lt;/span&gt;(bIsWindowsXPorLater)
  printf(&lt;span style="color: #a31515"&gt;&amp;quot;The system meets the requirements.\n&amp;quot;&lt;/span&gt;);
    &lt;span style="color: blue"&gt;else &lt;/span&gt;printf(&lt;span style="color: #a31515"&gt;&amp;quot;The system does not meet the requirements.\n&amp;quot;&lt;/span&gt;);
}&lt;/pre&gt;

&lt;p&gt;However there is a better way to verify the minimum OS version required using &lt;a href="http://msdn.microsoft.com/en-us/library/ms725492(VS.85).aspx"&gt;VerifiyVersionInfo()&lt;/a&gt;. This function compares a set of operating system version requirements to the corresponding values for the currently running version of the system. The following code example uses &lt;b&gt;VerifyVersionInfo&lt;/b&gt; to check the operating system version against minimal requirements (Windows XP SP2):&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;#include &lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;windows.h&amp;gt;
&lt;/span&gt;BOOL Is_WinXP_SP2_or_Later () 
{
   OSVERSIONINFOEX osvi;
   DWORDLONG dwlConditionMask = 0;
   &lt;span style="color: blue"&gt;int &lt;/span&gt;op=VER_GREATER_EQUAL;

   &lt;span style="color: green"&gt;// Initialize the OSVERSIONINFOEX structure.

   &lt;/span&gt;ZeroMemory(&amp;amp;osvi, &lt;span style="color: blue"&gt;sizeof&lt;/span&gt;(OSVERSIONINFOEX));
   osvi.dwOSVersionInfoSize = &lt;span style="color: blue"&gt;sizeof&lt;/span&gt;(OSVERSIONINFOEX);
   osvi.dwMajorVersion = 5;
   osvi.dwMinorVersion = 1;
   osvi.wServicePackMajor = 2;
   osvi.wServicePackMinor = 0;

   &lt;span style="color: green"&gt;// Initialize the condition mask.

   &lt;/span&gt;VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION, op );
   VER_SET_CONDITION( dwlConditionMask, VER_MINORVERSION, op );
   VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMAJOR, op );
   VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMINOR, op );

   &lt;span style="color: green"&gt;// Perform the test.

   &lt;/span&gt;&lt;span style="color: blue"&gt;return &lt;/span&gt;VerifyVersionInfo(
      &amp;amp;osvi, 
      VER_MAJORVERSION | VER_MINORVERSION | 
      VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
      dwlConditionMask);
}&lt;/pre&gt;

&lt;p&gt;In this code you can see how we use the VerifyVersion with a set of conditions to return TRUE incase we run on any OS grater than Windows XP Service Pack 2.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;For .NET Framework developers, use the ==, !=, &amp;lt;=, &amp;lt;, &amp;gt;, &amp;gt;= operators of the &lt;b&gt;Version&lt;/b&gt; object returned by &lt;b&gt;Environment.OSVersion.Version&lt;/b&gt;:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: green"&gt;// This code checks if the OS is at least Windows XP
  &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(Environment.OSVersion.Version &amp;lt; &lt;span style="color: blue"&gt;new &lt;/span&gt;Version(5, 1))
  {
        MessageBox.Show(&lt;span style="color: #a31515"&gt;&amp;quot;Windows XP or later required.&amp;quot;&lt;/span&gt;,
         &lt;span style="color: #a31515"&gt;&amp;quot;Incompatible Operating System&amp;quot;&lt;/span&gt;, MessageBoxButtons.OK,
                MessageBoxIcon.Error);
        &lt;span style="color: blue"&gt;return&lt;/span&gt;;
  }&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;It is highly recommended that you don’t check for version at all and try looking to work with features. It will prove valuable for the future…&lt;/p&gt;

&lt;p&gt;Just incase you want to read more, here are some useful links&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Application Compatibility Cookbook: &lt;a href="http://msdn.microsoft.com/en-us/library/bb963893.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb963893.aspx&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;Version Lie and Managed Applications: &lt;a href="http://blogs.msdn.com/cjacks/archive/2007/09/10/version-lie-shims-and-managed-code-on-windows-vista.aspx"&gt;http://blogs.msdn.com/cjacks/archive/2007/09/10/version-lie-shims-and-managed-code-on-windows-vista.aspx&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also &lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers.CodeSamples.AppCompat/VersionCHecking.zip" target="_blank"&gt;download a HOL and code sample for this topic&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=522166" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sample+Code/default.aspx">Sample Code</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Application+Compatibility/default.aspx">Windows 7 Application Compatibility</category></item><item><title>User Account Control Data Redirection</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/08/04/user-account-control-data-redirection.aspx</link><pubDate>Tue, 04 Aug 2009 19:27:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:521972</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>14</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=521972</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/08/04/user-account-control-data-redirection.aspx#comments</comments><description>&lt;p&gt;To making sure your application is ready (compatible) for Windows 7, I am going to start providing additional information about the few compatibility topics we introduced in the &amp;ldquo;&lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/07/23/is-your-application-ready-for-windows-7-rtm.aspx"&gt;Is Your Application Ready for Windows 7 RTM?&lt;/a&gt;&amp;rdquo; post. This post focuses UAC Virtualization or more known as Data Redirection.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What Are You Talking About?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Today, many applications are still designed to write files to the Program Files, Windows directories, or system root (typically the C drive) folders. Some applications are designed to update Microsoft&amp;reg; Windows registry values, specifically values in HKLM/Software. But there is one problem: the files or registry values are not created or updated. You may ask, &amp;ldquo;What&amp;rsquo;s going on? My application goes through the code and does not report an error. So where are my files?&amp;rdquo; &lt;/p&gt;
&lt;p&gt;To be specific, you may experience one or more of the following symptoms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Your application writes to Program Files, Windows directories, or the system root (typically the C drive) folders, but you can't find your files in these locations &lt;/li&gt;
&lt;li&gt;Your application writes to the Windows registry, specifically to HKLM/Software, but you can't see the registry updates &lt;/li&gt;
&lt;li&gt;You switch to another user account, and your application is unable to find files that were written to Program Files, Windows directories, or the system root (typically the C drive) folders, or it finds older versions of these files &lt;/li&gt;
&lt;li&gt;After turning User Account Control (UAC) on or off, your application is unable to find files in the Program Files or Windows directories &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If this happens to your application, it is experiencing &lt;strong&gt;UAC Virtualization&lt;/strong&gt; (AKA Data Redirection). The following information provides you with everything you need to know in order to detect this application compatibility problem, offers some solutions, and provides additional information about the specific nature of the compatibility problem.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Real Issue: UAC Virtualization&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Prior to Windows Vista, administrators typically ran applications. As a result, applications could freely read and write system files and registry keys. If standard users ran these applications, they would fail due to insufficient access. Windows Vista improved application compatibility for standard users by redirecting writes (and subsequent file or registry operations) to a per-user location within the user&amp;rsquo;s profile. &lt;/p&gt;
&lt;p&gt;For example, if an application attempts to write to C:\Program Files\Contoso\Settings.ini, and the user does not have permissions to write to that directory (the Program Files), the write operation will be &lt;strong&gt;redirected &lt;/strong&gt;to C:\Users\Username\AppData\Local\VirtualStore\Program Files\Contoso\settings.ini. If an application attempts to write to HKEY_LOCAL_MACHINE\Software\Contoso\ in the registry, it will automatically be &lt;strong&gt;redirected &lt;/strong&gt;to HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\Software\Contoso or HKEY_USERS\UserSID_Classes\VirtualStore\Machine\Software\Contoso.&lt;/p&gt;
&lt;p&gt;The following figure illustrates the two components of the Windows Virtualization process: file virtualization and registry virtualization:&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/bb756960.aspx"&gt;&lt;img height="291" width="315" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_4706E00C.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" /&gt;&lt;/a&gt; To learn more about UAC virtualization and new UAC technologies, see &amp;ldquo;New UAC Technologies for Windows Vista&amp;rdquo; at &lt;a href="http://msdn.microsoft.com/en-us/library/bb756960.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb756960.aspx&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Virtualization is intended only to &lt;strong&gt;assist&lt;/strong&gt; in application compatibility with existing programs. New applications designed for Microsoft Windows 7 &lt;b&gt;should NOT&lt;/b&gt; perform write operations to sensitive system areas, nor should they rely on virtualization to provide redress for incorrect application behavior. &lt;strong&gt;Always &lt;/strong&gt;develop applications for use with &lt;strong&gt;standard user &lt;/strong&gt;privileges and &lt;strong&gt;don&amp;rsquo;t &lt;/strong&gt;count on the application running under administrator privileges. Test your application with standard user privileges and not administrator privileges. &lt;/p&gt;
&lt;p&gt;If you are experiencing UAC virtualization with applications developed prior to Windows 7, re-design your applications to write files to the appropriate locations. When updating existing code to run on Windows 7, you should:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ensure that during run-time, applications store data only in &lt;b&gt;per-user locations&lt;/b&gt; or in computer locations within %alluserprofile% that have properly set access control list (ACL) settings. For more information about ACLs, see &lt;a href="http://msdn.microsoft.com/en-us/library/aa374872.aspx"&gt;Access Control Lists&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Determine the known folder to which you want to write the data files. Generic data used by all users should be written to a global public location that is shared by all users. All other data should be written to a per-user location. 
&lt;ul&gt;
&lt;li&gt;Generic data files can include, but are not limited to log files, settings files (INI/XML), saved state applications such as saved games, and so on &lt;/li&gt;
&lt;li&gt;User documents are different; they should be saved to the Documents folder (or to a location the user specifies) &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ensure that you &lt;b&gt;do not&lt;/b&gt; hard-code paths once you have determined the appropriate locations. Instead, use one of the following programming models and APIs to retrieve the correct paths of specific Windows known folders: 
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;C/C++ native applications: &lt;/b&gt;Use the&lt;b&gt; &lt;/b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb762188(VS.85).aspx"&gt;&lt;b&gt;SHGetKnownFolderPath&lt;/b&gt;&lt;/a&gt; function that retrieves the full path of a known folder identified by the folder's &lt;a href="http://msdn.microsoft.com/en-us/library/bb762584(VS.85).aspx"&gt;KNOWNFOLDERID&lt;/a&gt;, a GUID parameter indicating the known location you would like to obtain: 
&lt;ul&gt;
&lt;li&gt;FOLDERID_ProgramData &amp;ndash; Shared program data directory for all users &lt;/li&gt;
&lt;li&gt;FOLDERID_LocalAppData &amp;ndash; Per-user program data directory (non-roaming) &lt;/li&gt;
&lt;li&gt;FOLDERID_RoamingAppData &amp;ndash; Per-user program data directory (roaming) &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Managed Code&lt;/b&gt;: Use the &lt;a href="http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx"&gt;&lt;b&gt;System.Environment.GetFolderPath&lt;/b&gt;&lt;/a&gt; function. &lt;b&gt;GetFolderPath&lt;/b&gt; takes a parameter indicating the Known Location you would like to obtain 
&lt;ul&gt;
&lt;li&gt;Environment.SpecialFolder.CommonApplicationData &amp;ndash; Shared program data directory for all users &lt;/li&gt;
&lt;li&gt;Environment.SpecialFolder.LocalApplicationData &amp;ndash; Per-user program data directory (non-roaming) &lt;/li&gt;
&lt;li&gt;Environment.SpecialFolder.ApplicationData &amp;ndash; Per-user program data directory (roaming) &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;If none of the above-mentioned options are available, use the environment variable: 
&lt;ul&gt;
&lt;li&gt;%ALLUSERSPROFILE% &amp;ndash; Shared program data directory for all users &lt;/li&gt;
&lt;li&gt;%LOCALAPPDATA% &amp;ndash; Per-user program data directory (non-roaming) - Windows Vista or later &lt;/li&gt;
&lt;li&gt;%APPDATA% &amp;ndash; Per-user program data directory (roaming) - Windows Vista or later &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Steps to Determine the Most Appropriate Solution&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So far, we have presented the symptoms associated with UAC virtualization, explained why redirection is taking place, and suggested a solution. This section contains tests and procedures you should perform in order to pinpoint the real problem and plot a way to resolve it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Test #1:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Launch the application with &lt;strong&gt;standard user&lt;/strong&gt; privileges &lt;/li&gt;
&lt;li&gt;Run through the scenario that results in a write operation to any given protected folder such as the Program Files or system root (C:\) directories &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Expected results:&lt;/b&gt; The application &amp;ldquo;succeeds&amp;rdquo; in writing the file to the protected folder; however, you can't find the file in the expected location &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Conclusion:&lt;/b&gt; This suggests that UAC data virtualization is redirecting the file to a different location &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Test #2:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using Windows Explorer, search for your files in the VirtualStore folder 
&lt;ul&gt;
&lt;li&gt;The VirtualStore folder is a folder in your profile which stores redirected files &lt;/li&gt;
&lt;li&gt;The VirtualStore folder&amp;rsquo;s name and location are subject to change in later versions of Windows &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;First, attempt to find it under %localappdata%\VirtualStore &lt;/li&gt;
&lt;li&gt;If you are unable to find it there, try issuing dir %userprofile%\yourfile.dat /s /a at a command line (usually found C:\Users\&amp;lt;user name&amp;gt;\AppData\Local\VirtualStore) &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Expected results:&lt;/b&gt; You should find your file at the virtual store folder or sub folders &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Conclusion:&lt;/b&gt; This is proof that UAC virtualization is taking place &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Test #3&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Log in as an administrator and launch your application with administrator privileges. 
&lt;ul&gt;
&lt;li&gt;To launch the application with administrator privileges, right-click the file executable and select &lt;b&gt;Run as Administrator&lt;/b&gt; &lt;/li&gt;
&lt;li&gt;When an application runs with administrator privileges, virtualization is turned off, and the application now has sufficient privileges to write to the protected folders &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Do not &lt;/strong&gt;rely on permanently marking your application to &lt;strong&gt;require &lt;/strong&gt;administrator privileges as a way to bypass virtualization, as doing so will leave the system more vulnerable to attack, will prevent the application from running with limited or standard user privileges, and will needlessly annoy users with a UAC prompt &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Expected results:&lt;/b&gt; The application succeeds in writing the file to the protected folder, and you can find the file at the expected location &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Conclusion: &lt;/b&gt;Running the application with administrator privileges turns off virtualization and grants privileges &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Test #4&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Launch Process Monitor (ProcMon) 
&lt;ul&gt;
&lt;li&gt;To learn more about Process Monitor, visit the &lt;a target="_blank" href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx"&gt;Windows Sysinternals Process Monitor Web site&lt;/a&gt; on Microsoft TechNet &lt;/li&gt;
&lt;li&gt;During the hands-on lab, we will walk you through a detailed step-by-step process to use Process Monitor &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Configure filtering to show only file operations and only those operations performed by your process 
&lt;ul&gt;
&lt;li&gt;When you launch Process Monitor, the Process Monitor Filter dialog box appears &lt;br /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add the following entry to the filter: "Column=Process Name, Relation=is, Value=YourApp.exe, Action=Include"&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_42242C50.png"&gt;&lt;img height="328" width="523" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_734366F0.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;To invoke the Process Monitor Filter dialog box again, click this toolbar button &lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_596F30C1.png"&gt;&lt;img height="26" width="26" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_0A8E6B62.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;After clicking OK, configure Process Monitor to log only file events by enabling the following toolbar buttons as shown: &lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_3F2EC79D.png"&gt;&lt;img height="28" width="138" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_57BE64ED.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Press CTRL-X to clear the log; press CTRL-E to toggle logging on/off &lt;/li&gt;
&lt;li&gt;Expected results: You will see file operations whose results are REPARSE; the next line (with result SUCCESS) will usually be the redirected operation: &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_704E023D.png"&gt;&lt;img height="295" width="526" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_28204661.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Double-click the line representing the operation with REPARSE as the result and click the &lt;b&gt;Stack&lt;/b&gt; tab to show the call stack at the time of the operation: &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_3BCD2FF5.png"&gt;&lt;img height="429" width="501" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_6156AD56.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The pink K and blue U letters on the left of each stack frame show whether the stack frame is in kernel mode (K) or in user mode (U);in this case, we are interested only in user-mode stack frames &lt;/li&gt;
&lt;li&gt;In this example, the SaveFile function (at frame 21) in BrokenAppNative.exe is the one performing the operation which will be redirected &lt;/li&gt;
&lt;li&gt;You should configure symbols for a more meaningful display' for more information about configuring symbols, refer to the &lt;a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx"&gt;Debugging Tools for Windows Web site&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Conclusion:&lt;/b&gt; This test proves that UAC Virtualization did take place and shows you what operations in your application need to be corrected &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Task #5&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add a manifest to your application which contains a UAC directive 
&lt;ul&gt;
&lt;li&gt;This will mark your application as UAC-aware and will disable UAC virtualization &lt;/li&gt;
&lt;li&gt;A manifest is an XML document that developers embed as a resource in a DLL or .exe file, but can be a standalone file named &lt;i&gt;YourApp.exe.manifest&lt;/i&gt; or &lt;i&gt;YourDLL.dll.manifest&lt;/i&gt; &lt;/li&gt;
&lt;li&gt;Manifests can contain a variety of information that usually pertains to application compatibility, such as the exact version of Visual C++ runtime to load, the version of Common Controls Library to load, as well as UAC settings &lt;/li&gt;
&lt;li&gt;Read more about UAC settings in the manifest in the &lt;a href="http://msdn.microsoft.com/en-us/library/bb756929.aspx"&gt;Windows Vista Developer Story: Create and Embed an Application Manifest (UAC)&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Expected results:&lt;/b&gt; The application now fails to write to any of the protected folders, returning an &amp;ldquo;access denied&amp;rdquo; error 
&lt;ul&gt;
&lt;li&gt;This is a &lt;strong&gt;GOOD&lt;/strong&gt; result, because the UAC data virtualization &lt;strong&gt;didn&amp;rsquo;t &lt;/strong&gt;kick into action &lt;/li&gt;
&lt;li&gt;As the developer, you should be able to recognize this (because you marked the application as UAC-aware in the manifest) and avoid writing to any of the protected areas &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Conclusion:&lt;/b&gt; Windows enables virtualization because the application isn&amp;rsquo;t marked as UAC-aware. Marking your application as UAC-aware disables virtualization. If your app tries to write to protected store while marked as UAC-aware, you will get an access denied exception &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Hands On Labs and Additional Material&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;you can &lt;a target="_blank" href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers.CodeSamples.AppCompat/Data-Redirection.zip"&gt;download&lt;/a&gt; this doc, a presentation describing UAC Virtualization, and &lt;a target="_blank" href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers.CodeSamples.AppCompat/Data-Redirection.zip"&gt;two full hands on labs on this topic&lt;/a&gt;, one for managed code and one for native, from &lt;a target="_blank" href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers.CodeSamples.AppCompat/Data-Redirection.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tools &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In order to detect UAC virtualization we use the following tools:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Process Monitor&lt;/b&gt;, a free and advanced Microsoft tool that monitors and logs file system, registry, network, and process activity 
&lt;ul&gt;
&lt;li&gt;To learn more about Process Monitor, see the &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx"&gt;Process Monitor page&lt;/a&gt; at the Windows Sysinternals Web site &lt;/li&gt;
&lt;li&gt;Download Process Monitor from &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx"&gt;Microsoft TechNet&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Standard User Analyzer&lt;/b&gt;, part of the Microsoft Application Compatibility Toolkit, is a free tool that monitors resource (file, registry, and others) usage of a given application and reports activity that is responsible for Standard User problems 
&lt;ul&gt;
&lt;li&gt;To learn more about Standard User Analyzer see &lt;a href="http://technet.microsoft.com/en-us/library/cc766021.aspx"&gt;&amp;ldquo;Standard User Analyzer&amp;rdquo;&lt;/a&gt; at Microsoft TechNet &lt;/li&gt;
&lt;li&gt;To obtain Standard User Analyzer, &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=24da89e9-b581-47b0-b45e-492dd6da2971&amp;amp;displaylang=en"&gt;download the Microsoft Application Compatibility Toolkit&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Additional Resources&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows Vista Application Compatibility: UAC: Standard User Changes &amp;ndash; &lt;a href="http://msdn.microsoft.com/en-us/library/bb963893.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb963893.aspx&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Common file and registry virtualization issues in Windows Vista &amp;ndash; &lt;a href="http://support.microsoft.com/kb/927387"&gt;http://support.microsoft.com/kb/927387&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;New UAC Technologies for Windows Vista &amp;ndash; &lt;a href="http://msdn.microsoft.com/en-us/library/bb756960.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb756960.aspx&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Inside Windows Vista User Account Control &amp;ndash; &lt;a href="http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx"&gt;http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=521972" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Application+Compatibility/default.aspx">Windows 7 Application Compatibility</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Labs/default.aspx">Labs</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Data+Redirection/default.aspx">Data Redirection</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/UAC+Virtualization/default.aspx">UAC Virtualization</category></item><item><title>Is Your Application Ready for Windows 7 RTM?</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/07/23/is-your-application-ready-for-windows-7-rtm.aspx</link><pubDate>Thu, 23 Jul 2009 08:29:02 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:520121</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>48</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=520121</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/07/23/is-your-application-ready-for-windows-7-rtm.aspx#comments</comments><description>&lt;p&gt;Yesterday Windows 7 completed a major milestone--&lt;a href="http://windowsteamblog.com/blogs/windows7/archive/2009/07/22/windows-7-has-been-released-to-manufacturing.aspx" target="_blank"&gt;release to manufacturing&lt;/a&gt; (RTM)! And in three months time – on October 22&lt;sup&gt;nd&lt;/sup&gt; – Windows 7 will be available for everyone to enjoy. Excitement about the upcoming public release of Windows 7 has been growing for months and expectations are for a much quicker adoption rate than what we saw with the previous Windows version. &lt;/p&gt;  &lt;p&gt;As we approach October 22&lt;sup&gt;nd&lt;/sup&gt; you need to ask yourself: Is your application ready for Windows 7? What will happen when end users install your application on Windows 7? Will your application run? Will your application behave like a Windows 7 first class citizen? Will users see any difference when running applications on Windows 7 versus Windows Vista or XP? October 22&lt;sup&gt;nd&lt;/sup&gt; is just around the corner and we are here to help you answer, “&lt;b&gt;YES!&lt;/b&gt;” to these questions and&lt;b&gt; &lt;/b&gt;be able to&lt;b&gt; &lt;/b&gt;state with confidence that, &lt;b&gt;“Absolutely, my application &lt;i&gt;rocks&lt;/i&gt; on Windows 7&lt;/b&gt;.” We want to help your users get the best possible Windows 7 experience from your application starting on Day 1.&lt;/p&gt;  &lt;p&gt;All this sounds great, but what steps do you need to take in order to be able to say: “Yes my application is a first-class Windows citizen”? Is there a check list? You bet!&lt;/p&gt;  &lt;p&gt;You need to do three things to ensure a smooth transition:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Make sure your application is Windows 7 compatible &lt;/li&gt;    &lt;li&gt;Optimize your application experience and performance for Windows 7 &lt;/li&gt;    &lt;li&gt;Provide new and exciting user experiences with Windows 7&amp;#160; &lt;/li&gt; &lt;/ol&gt;  &lt;ol&gt;&lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Make sure your application is Windows 7 compatible&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Before considering using any new Windows 7 features, make sure your application is compatible with Windows 7. There is no escape from this; it is essential that you make sure that your application runs well on Windows 7. There is nothing worse for an end user than to be excited about the new Windows 7 operating system just to discover that a favorite application doesn’t perform properly. A bad user experience hurts everyone--which is why you have to make sure your application installs and runs on all Windows 7 versions (including E - &lt;i&gt;&lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/07/13/windows-7-e-best-practices-for-isvs.aspx"&gt;Windows 7 E Best Practices for ISVs&lt;/a&gt;&lt;/i&gt;) and supports both 32- and 64-bit versions. &lt;/p&gt;  &lt;p&gt;If your application is compatible with Windows Vista you are in a good shape! We expect most applications that run on Windows Vista to run on Windows 7. Obviously, you can’t take this for granted and must check (and double check) that your application truly is compatible with Windows 7. There are a few differences between Windows Vista and Windows 7 that can affect specific application functions, so if you haven’t checked the &lt;a href="http://code.msdn.microsoft.com/Windows7AppQuality"&gt;&lt;i&gt;Windows 7 Quality Cookbook&lt;/i&gt;&lt;/a&gt; lately, we highly recommend that you do so. &lt;/p&gt;  &lt;p&gt;If your application was designed for Windows XP (or earlier Windows versions), and you haven't confirmed its compatibility with Windows Vista, there are a few areas (for example, UAC), that you should especially note. It is important to keep in mind that there is no one silver bullet for application compatibility issues. Each application comes with its own set of issues that are dependent on specific implementation details. The &lt;a href="http://msdn.microsoft.com/library/bb757005"&gt;&lt;i&gt;Windows Vista Application Compatibility Cookbook&lt;/i&gt;&lt;/a&gt; is still very relevant for Windows 7, as 99% of its topics apply to Windows 7. With that said, a few topics rise above the others. The following seven areas represent about a large number of the reported application compatibility problems.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Version Checking&lt;/b&gt; – by far the top application compatibility problem. Ever get a message from an application saying, “Requires Windows XP or higher” when you are running on Windows 7? If so, you hit a version checking issue. You can read more about this topic - &lt;a href="http://msdn.microsoft.com/en-us/library/bb756927.aspx" target="_blank"&gt;Application Compatibility: Operating System Versioning&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Data Redirection&lt;/b&gt; – beginning with Windows Vista, standard users have restricted access to certain files, folders, and registry keys. When an application is trying to write to these locations, it gets redirected to somewhere else. Most of the time this is transparent to both users and application developers, but sometimes it is not and that lead to some very interesting results. You can read about this topic - &lt;a href="http://support.microsoft.com/kb/927387" target="_blank"&gt;Common file and registry virtualization issues in Windows Vista&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;IE Protected Mode &lt;/b&gt;– starting with Windows Vista, by default IE runs with lower privileges. This usually means that some ActiveX controls that work on Windows XP don’t work on Windows Vista and Windows 7. Need more information, you can read &lt;a href="http://blogs.msdn.com/ie/archive/2006/02/09/528963.aspx" target="_blank"&gt;Protected Mode in Vista IE7&lt;/a&gt; (and yes this is still applicable for IE8.) &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Session 0 Isolation&lt;/b&gt; - in Windows Vista, services run in their own session (session 0) and not in the user session(s) (session 1 and above). This security boundary protects the system from many vicious attack vectors and is absolutely necessary. However, it also introduces communication problems between services and application like blocking your messages! You can read more about this topic -&amp;#160; &lt;a href="http://blogs.msdn.com/cjacks/archive/2006/10/24/modifying-the-mandatory-integrity-level-for-a-securable-object-in-windows-vista.aspx" target="_blank"&gt;Modifying the Mandatory Integrity Level for a Securable Object in Windows Vista&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Installer Detection&lt;/b&gt; – starting with Windows Vista, the OS automatically tries to detect if a given application is an installer application, which usually means that the application requires elevation to administrator privileges. However, sometimes these heuristics can cause problems. Interested in additional information, read about &lt;a href="http://msdn.microsoft.com/en-us/library/aa905330.aspx" target="_blank"&gt;The Windows Vista and Windows Server® 2008 Developer Story&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;User Interface Privilege Isolation&lt;/b&gt; – this prevents an application (process) from sending messages to another process with higher privileges even if running under the same user's account. While this protects from shatter attacks, it can also break some applications. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;High DPI&lt;/b&gt; –during install, Windows 7 automatically detects whether your screen supports High DPI. If it does, Windows 7 automatically sets the screen resolution to High DPI. If your application is not High DPI aware, this may cause some display issues (like text clipping). Read more about &lt;a href="http://msdn.microsoft.com/en-us/library/dd756693(VS.85).aspx" target="_blank"&gt;Ensuring your application displays properly on High-DPI Displays&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In the following weeks, we will address in detail each of the above topics to help you get ready for Windows 7.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Optimize your application experience and performance for Windows 7&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;After verifying that your application can install and run on Windows 7 without any problems, it is time to step up and optimize your application’s user experiences and performance while running on Windows 7. Do this by taking advantage of the great new features offered with Windows 7. These include new user interface innovations like the Taskbar and Libraries, to more fundamental features like Trigger Start Services or the new Troubleshooting platform. By optimizing your application for Windows 7, you can make sure that your end user's experiences when running your application on Windows 7 surpasses their expectations. Users will expect applications to work properly with the Taskbar (just one example); but if your application is not optimized for the new Windows 7 Taskbar experience, end users might just notice that. &lt;/p&gt;  &lt;p&gt;When you're ready to optimize your application for Windows 7, you might consider using one or more of the following features:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="20" width="580"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="370"&gt;         &lt;ul&gt;           &lt;li&gt;&lt;b&gt;Taskbar &lt;/b&gt;– The new Taskbar in Windows 7 provides more information to the user in more intuitive ways, with features like Jump Lists that helps users quickly “jump” into where they want to go. You can read more &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/06/18/developing-for-the-windows-7-taskbar-application-id.aspx"&gt;Developing for the Windows 7 Taskbar – Application ID&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;b&gt;Libraries &lt;/b&gt;–&lt;b&gt; &lt;/b&gt;Libraries are the primary entry points to user data in Windows 7. A Windows 7 Library is a user-defined collection of content that represents the user’s data independently from the folder hierarchy. Users can unify and flatten the folder hierarchy by aggregating any number of physical locations (on their local machine or on remote machines) into a single view – which is the library. You can read more - &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/06/11/windows-7-programming-guide-libraries.aspx"&gt;Windows 7 Programming Guide – Libraries&lt;/a&gt;. &lt;/li&gt;         &lt;/ul&gt;       &lt;/td&gt;        &lt;td valign="top" width="210"&gt;         &lt;br /&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_0C2CB989.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_7D15DAAE.png" width="205" height="319" /&gt;&lt;/a&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Trigger Start Services&lt;/b&gt; – The Windows 7 Service Control Manager has been extended so that a service can be automatically started and stopped when a specific system event, or trigger, occurs on the system. Trigger-start capabilities remove the need for services to start up automatically at computer startup and then poll or wait for an event to occur, such as a device arrival. More about this topic – &lt;a href="http://msdn.microsoft.com/en-us/library/dd405513(VS.85).aspx" target="_blank"&gt;Service Trigger Events&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Power Optimization&lt;/b&gt; – Windows 7 provides the infrastructure and tools that make it easy for developers to determine the energy impact of their applications. A set of event callbacks enable applications to reduce their activity when the system is on battery power and automatically scale up when the system is on AC power.&lt;b&gt;&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Troubleshooting Platform &lt;/b&gt;– Windows 7 delivers a comprehensive and extensible Troubleshooting Platform that uses a PowerShell-based mechanism to troubleshoot and resolve problems. The Troubleshooting Platform seamlessly integrates with the Windows 7 PC Solution Center, enabling other applications to execute diagnostics in a similar manner as part of their PC management regimen. Read more about &lt;a href="http://msdn.microsoft.com/en-us/library/dd323778(VS.85).aspx" target="_blank"&gt;Windows Troubleshooting Platform&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_3C075B4A.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_1B13E8A3.png" width="350" height="268" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Windows Error Reporting &lt;/b&gt;- Windows Error Reporting (WER) is a set of Windows technologies that capture software crash data and support end-user reporting of crash information. Through Winqual services, software and hardware vendors can access reports in order to analyze and respond to these problems. This set of tools provides amazing real-time information about the quality of your software and can help facilitate software updates and patches. &lt;a href="http://www.microsoft.com/whdc/maintain/StartWER.mspx" target="_blank"&gt;Get Started with Windows Error Reporting&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;I/O Optimization&lt;/b&gt; – I/O prioritization improves the responsiveness of the system without significantly decreasing the throughput of the system. If you have any I/O-bound long services that you can run in the background, the user will be thankful. Non-I/O optimized applications tend to hug the I/O and put an extra burden on the system. If your application optimizes the I/O for non critical application services, it can dramatically improve the overall system behavior. &lt;b&gt;&lt;/b&gt;&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Restart Manager&lt;/b&gt; – This technology allows automatic post-crash restarts as well as application and operating system updates without rebooting the entire machine. When you implement this functionality, you get a second chance to save critical information if your application crashes. Windows will automatically restart your application and try to reload the information the user just used. This same technology facilitates updating most applications and the operating system without the need to reboot. If a reboot is needed, then Windows will make sure your application restarts and returns to its latest state &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Provide new and exciting user experiences with Windows 7&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Once your application has passed the first two steps, you can really differentiate your it by creating new and exciting user experiences. Windows 7 enables developers to create distinctive and intuitive applications that significantly enhance discoverability, usability, and sheer enjoyment. New methods of desktop integration put application functionality right at the user’s fingertips. New Touch APIs enable natural interactions through multitouch and finger-panning gestures. Rapid advances in hardware and software technology are also driving higher-fidelity user experiences. Windows 7 brings these advances under developer control with new and flexible APIs that take full advantage of the technology, while making it even easier to develop compelling applications.&lt;/p&gt;  &lt;p&gt;Windows 7 includes many new features that can make your application shine, raising it above the competition. When you think about creating new and exciting user experiences, consider using one or more of the following features:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Ribbon&lt;/b&gt; – Windows 7 features the Ribbon interface from Office 2007 throughout the operating system, enabling improved user interface development on the platform. This means that developers can eliminate much of the drudgery of Win32 UI development and deliver a rich, graphical, animated, and highly familiar user interface by using the markup-based UI and a small, high-performance, native code runtime. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_20EE8C3C.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_3911F697.png" width="565" height="68" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Multitouch&lt;/b&gt;&amp;#160;&lt;b&gt;&amp;amp; Ink&lt;/b&gt; – Windows 7 features improved touch and gesture support, empowering developers to quickly and easily create unique application experiences that go beyond simple mouse pointing, clicking, and dragging. The new multi-touch APIs support rich gestures, such as pan, zoom, and rotate. All gestures provide direct visual feedback, and interact with underlying content in a natural and intuitive manner. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Sensor and Location Platform&lt;/b&gt; - Windows 7 has changed how developers use sensors. It includes native support for sensors, expanded by a new development platform for working with sensors, including location sensors (such as GPS devices) and sensors (such as an ambient light sensor or a temperature gauge), to create environmental awareness in Windows applications. Location sensors can unlock new opportunities for location-based services. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;New Graphics Stack&lt;/b&gt; – Windows 7 puts new graphics capability into the hands of application developers through a new set of DirectX APIs. Win32 developers can take advantage of the latest innovations in GPUs to add fast, scalable, high-quality, 2D and 3D graphics, text, and images to their applications. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_460BD6A8.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/image_5F00_thumb_5F00_453370BE.png" width="240" height="198" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Media Platform&lt;/b&gt; – Media Foundation and DirectShow® provide the basis for media support in Windows. Media Foundation was introduced in Windows Vista as the replacement for DirectShow. In Windows 7, Media Foundation has been enhanced to provide better format support, including:       &lt;ul&gt;       &lt;li&gt;MPEG-4, &lt;/li&gt;        &lt;li&gt;Support for video capture devices and hardware codecs, including H.264 video, MJPEG, and MP3 &lt;/li&gt;        &lt;li&gt;New sources for MP4, 3GP, MPEG2-TS, and AVI &lt;/li&gt;        &lt;li&gt;New file sinks for MP4, 3GP, and MP3 &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;And for developers Windows 7 adds new high-level APIs that make it much simpler to write media applications. &lt;/p&gt;  &lt;li&gt;&lt;b&gt;Federated Search&lt;/b&gt; – Windows 7 supports searching for documents beyond the user’s own PC. Developers and IT professionals can enable their search engines, document repositories, Web applications, and proprietary data stores to be searched from Windows 7 without needing to write and deploy client code. This enables end users to search their corporate intranet or the Web as easily as they can search their local files—all from within the same familiar Windows interface. &lt;/li&gt;  &lt;li&gt;&lt;b&gt;Device Stage Integration&lt;/b&gt; – Windows 7 combines software and services to create exciting new experiences for mobile phones, portable media players, cameras, and printers. Windows 7 makes it easier to use these devices directly from the Windows desktop. It also provides device makers with prominent placement on the Windows desktop, with branding opportunities and a simple interface for presenting the functionality and services that the device supports.     &lt;p&gt;&lt;/p&gt;    &lt;p&gt;I hope this post give you enough to start work with, making sure your application rocks on Windows 7!&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt; &lt;/li&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=520121" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Multi-Touch/default.aspx">Multi-Touch</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sensor+and+Location/default.aspx">Sensor and Location</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Libraries/default.aspx">Libraries</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/.NET/default.aspx">.NET</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7+Application+Compatibility/default.aspx">Windows 7 Application Compatibility</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/ETW/default.aspx">ETW</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Source+Code/default.aspx">Source Code</category></item><item><title>7 Ways to Get Free Tickets to PDC 2009 Plus up to $17,777</title><link>http://windowsteamblog.com/blogs/developers/archive/2009/07/14/7-ways-to-get-free-tickets-to-pdc-2009-plus-up-to-17-777.aspx</link><pubDate>Tue, 14 Jul 2009 20:16:50 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:518731</guid><dc:creator>Yochay Kiriaty</dc:creator><slash:comments>33</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/developers/rsscomments.aspx?PostID=518731</wfw:commentRss><comments>http://windowsteamblog.com/blogs/developers/archive/2009/07/14/7-ways-to-get-free-tickets-to-pdc-2009-plus-up-to-17-777.aspx#comments</comments><description>&lt;p&gt;Do you want to win a free trip to Los Angeles and a free ticket to PDC 2009? Do you think you have what it takes to win $17,777? Do you think you can write an amazing Windows 7 application?&lt;/p&gt;  &lt;p&gt;Well, if your answer to any of the above question is &amp;quot;Yes!&amp;quot; then say hello to the &lt;a href="https://www.code7contest.com/"&gt;Code&lt;sup&gt;7&lt;/sup&gt; Contest&lt;/a&gt;. The Code&lt;sup&gt;7&lt;/sup&gt; contest is where your application design ingenuity gives you the opportunity to get millions of eyes on your work, plus a trip to LA for PDC09, and up to &lt;b&gt;$17,777 in cash!&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/clip_5F00_image002_5F00_6FD1F86B.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developers/clip_5F00_image002_5F00_thumb_5F00_0F80D234.jpg" width="538" height="307" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Code&lt;sup&gt;7&lt;/sup&gt; is a special coding contest for developers. It is a great opportunity to show the world your creativity and coding powers. It is a way for you to cash in on your knowledge and skills. &lt;/p&gt;  &lt;p&gt;This is not just another standard code contest; this contest gives the finalists the opportunity to present their application at PDC 2009 in LA. The first prize is a real gem: $17,777 in cash, the opportunity to present the application to Microsoft executives at PDC 2009, plus worldwide interest in your application including a massive “marketing bump” for your application.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;To enter, you must: &lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Build an original, consumer-oriented client application prototype that runs natively on Windows 7 (for example Win32, WPF, MFC or WinForms – not an Air application or just a gadget) and addresses one or more of the following topic categories: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Simplify My Life &lt;/li&gt;    &lt;li&gt;More Media, More Places &lt;/li&gt;    &lt;li&gt;Gaming &lt;/li&gt;    &lt;li&gt;Work From Anywhere &lt;/li&gt;    &lt;li&gt;Safeguard Your Work &lt;/li&gt;    &lt;li&gt;Applications for a Better Tomorrow &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The application &lt;b&gt;must&lt;/b&gt; use at least one of the following Windows 7 technology features; however, judging will give more weight to entries that take advantage of more than one of these features: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Libraries &lt;/li&gt;    &lt;li&gt;Windows Touch &lt;/li&gt;    &lt;li&gt;Shell Integration &lt;/li&gt;    &lt;li&gt;DX11 (DirectX 11) &lt;/li&gt;    &lt;li&gt;Sensor and Location Platform &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So if you have being following my blog you have some advantage. &lt;/p&gt;  &lt;p&gt;The contest has several stages and few rules you need to be aware of:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;To enter this contest you must create and submit a &lt;b&gt;video&lt;/b&gt; in which you describe and demonstrate your application. &lt;/li&gt;    &lt;li&gt;The &lt;strong&gt;first qualifying&lt;/strong&gt; round starts at 12:00 a.m. Pacific Time (PT) on &lt;strong&gt;July 13, 2009&lt;/strong&gt;, and ends at 11:59 p.m. PT on &lt;strong&gt;October 10, 2009&lt;/strong&gt; (“Entry Period”). You will be able to able to submit your video until &lt;strong&gt;midnight October 10, 2009&lt;/strong&gt;. Your entry will be included in a pool with all eligible entries based on your geographical region. &lt;/li&gt;    &lt;li&gt;Entries received by 11:59 p.m. PT on &lt;strong&gt;August 15, 2009&lt;/strong&gt;, will be eligible to win an “Early Bird” prize described in the Winner Determination section below. &lt;/li&gt;    &lt;li&gt;Following the close of the first qualifications, a panel of judges will select two runner-up winners and one Finalist from each Region. &lt;/li&gt;    &lt;li&gt;Following judging, Microsoft will notify all winners and finalists and provide instructions for submitting their applications for evaluation. &lt;/li&gt;    &lt;li&gt;Finalists will be invited to present their applications to a panel of judges at the Microsoft Partner Developer Conference 2009 (PDC09) in Los Angeles, CA, USA. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;For the complete contest rules and legal notice, please refer to the “RULES” section on the Code7 Contest Web site - &lt;a href="https://www.code7contest.com/"&gt;https://www.code7contest.com/&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;So, what are you waiting for? Get going and start working on your Windows 7 application!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=518731" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Developers/default.aspx">Developers</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Multi-Touch/default.aspx">Multi-Touch</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Sensor+and+Location/default.aspx">Sensor and Location</category><category domain="http://windowsteamblog.com/blogs/developers/archive/tags/Libraries/default.aspx">Libraries</category></item></channel></rss>