<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">The Windows 7 Blog for Developers</title><subtitle type="html" /><id>http://blogs.msdn.com/b/yochay/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/yochay/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2008-10-28T19:38:02Z</updated><entry><title>New Post on Windows 7 for Developers</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2009/03/31/new-post-on-windows-7-for-developers.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2009/03/31/new-post-on-windows-7-for-developers.aspx</id><published>2009-03-31T04:04:06Z</published><updated>2009-03-31T04:04:06Z</updated><content type="html">&lt;p&gt;&lt;b&gt;Remember – we Moved to a &lt;a href="http://windowsteamblog.com/blogs/developers/default.aspx"&gt;new location&lt;/a&gt;.&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;There is a new post on Windows 7 for Developers - &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/03/30/windows-7-net-interop-sample-libraries.aspx"&gt;Windows 7 .NET Interop Sample Libraries&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9520962" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Windows 7 Blog for Developer Is Moving!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2009/03/30/windows-7-blog-for-developer-is-moving.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2009/03/30/windows-7-blog-for-developer-is-moving.aspx</id><published>2009-03-31T01:50:48Z</published><updated>2009-03-31T01:50:48Z</updated><content type="html">&lt;a href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WelcometotheWindows7forDevelopersBlog_D80F/moving-trolley_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="moving-trolley" border="0" alt="moving-trolley" align="right" src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WelcometotheWindows7forDevelopersBlog_D80F/moving-trolley_thumb.jpg" width="150" height="206" /&gt;&lt;/a&gt;   &lt;p&gt;That's right folks, we are moving to a &lt;a href="http://windowsteamblog.com/blogs/developers/default.aspx"&gt;new location&lt;/a&gt;, becoming part of&amp;#160; &lt;a href="http://windowsteamblog.com/"&gt;The Windows Blog&lt;/a&gt;. As part of The Windows Blog, we will join the greater Windows messaging community and will be better able to ensure developers are up to date with both the latest news on the Windows 7 Development story and the Windows 7 User Experience story. The Windows Blog hosts several “satellite” blogs, including:&lt;/p&gt;  &lt;p&gt;· &lt;a href="http://windowsteamblog.com/blogs/windowsvista/default.aspx"&gt;Windows Vista Team Blog&lt;/a&gt; – to stay updated with news about Windows Vista&lt;/p&gt;  &lt;p&gt;· &lt;a href="http://windowsteamblog.com/blogs/windowsexperience/default.aspx"&gt;Windows Experience Blog&lt;/a&gt; –to read about the amazing user experiences you can have with Windows 7&lt;/p&gt;  &lt;p&gt;· &lt;a href="http://windowsteamblog.com/blogs/windows7/default.aspx?PageIndex=1"&gt;Windows 7 Team Blog&lt;/a&gt; – to learn about all the important Windows 7 news and announcements&lt;/p&gt;  &lt;p&gt;· &lt;a href="http://windowsteamblog.com/blogs/windowssecurity/default.aspx"&gt;Windows Security Blog&lt;/a&gt; –to become aware of all the things that go into having a secure Windows environment&lt;/p&gt;  &lt;p&gt;· &lt;a href="http://windowsteamblog.com/blogs/business/default.aspx"&gt;Windows for your Business&lt;/a&gt; – to discover ways Windows 7 benefits commercial customers&lt;/p&gt;  &lt;p&gt;And, of course, the new &lt;a href="http://windowsteamblog.com/blogs/developers/default.aspx"&gt;Windows 7 for Developer Blog&lt;/a&gt;, which is our Windows 7 developer-focused blog. Our focus here will remain on topics of special interest to the Windows 7 developer community and we will continue to provide both native and managed code examples and insights.&lt;/p&gt;  &lt;p&gt;I will still post to this blog, but about more general topics and ideas. &lt;/p&gt;  &lt;p&gt;See you all at the new blog location - &lt;a href="http://windowsteamblog.com/blogs/developers/default.aspx"&gt;http://windowsteamblog.com/blogs/developers/default.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Make sure you update your RSS feeds to the &lt;a href="http://windowsteamblog.com/blogs/developers/rss.aspx"&gt;new blog RSS feed&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9520619" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author><category term="Windows 7" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7/" /><category term="Developers" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Developers/" /><category term="Microsoft" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Microsoft/" /><category term="Windows 7 for Developer Blog" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7+for+Developer+Blog/" /></entry><entry><title>It used to be “write once - deploy anywhere”</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2009/03/20/it-used-to-be-write-once-deploy-anywhere.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2009/03/20/it-used-to-be-write-once-deploy-anywhere.aspx</id><published>2009-03-20T22:54:03Z</published><updated>2009-03-20T22:54:03Z</updated><content type="html">&lt;p&gt;Not so long ago, there was a catchy phrase we used in regard&lt;s&gt;s&lt;/s&gt; to developing, “write once – deploy anywhere.” Regardless of your programming preferences - .NET, Java, C/C++, this statement continues to be challenged as it is not really that easy to write once and deploy anywhere, it is more like, “write once – test everywhere…” But now, instead of targeting a specific OS such as Windows, Mac, or Linux, when&amp;#160; people say&lt;s&gt;s&lt;/s&gt; “write once - deploy anywhere,” what they &lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Itusedtobewriteoncedeployanywhere_B522/superpreviewforie_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px 0px 0px 20px; display: inline; border-top: 0px; border-right: 0px" title="superpreviewforie" border="0" alt="superpreviewforie" align="right" src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Itusedtobewriteoncedeployanywhere_B522/superpreviewforie_thumb.jpg" width="240" height="135" /&gt;&lt;/a&gt;&lt;/b&gt;really mean is write once and deploy on &lt;b&gt;every&lt;/b&gt; available &lt;b&gt;browser&lt;/b&gt;. As announced at the Mix 09 &lt;a href="http://videos.visitmix.com/MIX09/KEY01"&gt;Day 1 Keynote&lt;/a&gt;, with the new Expression Web SuperPreview (one of the coolest features announced for Web Developers), this statement seems to be true for both standard html as well as Silverlight applications. Code your markup&lt;s&gt;,&lt;/s&gt; and compare it to Firefox, Safari, IE6, and even to your PhotoShop comps to make sure that your design is pixel-perfect! Indeed, these are truly exciting times. You can &lt;a href="http://download.microsoft.com/download/5/6/8/568F0D28-0434-4794-B7FC-FB293BCC98FB/SuperPreview_Trial_en.exe"&gt;download the SuperPreview trial here&lt;/a&gt; and can find a more detailed session &lt;s&gt;on&lt;/s&gt; from Mix 09 here: &lt;a href="http://videos.visitmix.com/MIX09/C03F"&gt;Microsoft Expression Web: No Platform Left Behind&lt;/a&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;a href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Itusedtobewriteoncedeployanywhere_B522/superpreview2_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="superpreview2" border="0" alt="superpreview2" src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Itusedtobewriteoncedeployanywhere_B522/superpreview2_thumb.jpg" width="450" height="441" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9493349" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author><category term="Microsoft" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Microsoft/" /><category term="Expression Web" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Expression+Web/" /><category term="Mix09" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Mix09/" /><category term="SuperPreview" scheme="http://blogs.msdn.com/b/yochay/archive/tags/SuperPreview/" /></entry><entry><title>New Windows 7 Content on Channel 9</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2009/01/08/new-windows-7-content-on-channel-9.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2009/01/08/new-windows-7-content-on-channel-9.aspx</id><published>2009-01-08T11:33:00Z</published><updated>2009-01-08T11:33:00Z</updated><content type="html">&lt;P&gt;With the Windows 7 Beta announcement today at CES, we are &lt;A href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/NewWindows7ContentonChannel9_7D5/win7_ch9_homepage_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/NewWindows7ContentonChannel9_7D5/win7_ch9_homepage_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 5px 10px 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=win7_ch9_homepage border=0 alt=win7_ch9_homepage align=right src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/NewWindows7ContentonChannel9_7D5/win7_ch9_homepage_thumb.jpg" width=194 height=131 mce_src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/NewWindows7ContentonChannel9_7D5/win7_ch9_homepage_thumb.jpg"&gt;&lt;/A&gt;transforming the Channel 9 theme into the Windows 7 theme. To&amp;nbsp; facilitate this, we are introducing new set of videos exploring key Windows 7 features and topics. Our goal is to provide a series of videos on key topics starting with overview videos but quickly diving into the guts of the technical details. We are coupling these videos with technical blog posts and code samples for you to download. &lt;/P&gt;
&lt;P&gt;There is a lot of ground to cover and many topics to explore. We will start with a series of videos and blogs on the new Windows 7 Taskbar: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://channel9.msdn.com/posts/yochay/Windows-7-New-Taskbar-an-overview/" target=_blank mce_href="http://channel9.msdn.com/posts/yochay/Windows-7-New-Taskbar-an-overview/"&gt;Windows 7 New Taskbar – An Overview&lt;/A&gt; is an introductory video to the new Windows 7 Taskbar. It provides a very good starting point for learning about all the cool new Windows 7 Taskbar features and it sets the context for the following videos. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://channel9.msdn.com/posts/yochay/Designing-the-Windows-7-Taskbar/" target=_blank mce_href="http://channel9.msdn.com/posts/yochay/Designing-the-Windows-7-Taskbar/"&gt;Designing the Windows 7 Taskbar&lt;/A&gt; is a “personal” view of the User Interface and User Experience design process and an insider’s view of some of the reasons underlying Windows 7 Taskbar behaviors. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://channel9.msdn.com/posts/yochay/Windows-7-Taskbar-Behind-the-Scenes/" target=_blank mce_href="http://channel9.msdn.com/posts/yochay/Windows-7-Taskbar-Behind-the-Scenes/"&gt;Windows 7 Taskbar – Behind the Scenes&lt;/A&gt; provides a technical overview of the Taskbar architecture, programming model, and API. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://channel9.msdn.com/posts/yochay/Jump-into-the-Windows-7-Taskbar-Jump-Lists/" target=_blank mce_href="http://channel9.msdn.com/posts/yochay/Jump-into-the-Windows-7-Taskbar-Jump-Lists/"&gt;Jump into the Windows 7 Jump Lists&lt;/A&gt; is a technical deep dive into the Windows 7 Jump Lists programming model and APIs. It also provides an insight into the importance of providing Application ID for applications. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A href="http://blogs.msdn.com/yochay/archive/2009/01/06/windows-7-taskbar-part-1-the-basics.aspx" target=_blank mce_href="http://blogs.msdn.com/yochay/archive/2009/01/06/windows-7-taskbar-part-1-the-basics.aspx"&gt;Windows 7 Taskbar – Part 1, The Basics&lt;/A&gt; is the first post in a series on code posts on Windows 7 Taskbar API and programming model.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;More content comming soon.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9295362" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author><category term="Windows 7" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7/" /><category term="Developers" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Developers/" /><category term="Windows 7 Beta" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7+Beta/" /><category term="Taskbar" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Taskbar/" /><category term="Channel 9" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Channel+9/" /></entry><entry><title>Windows 7 Beta – Go Get It!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2009/01/08/windows-7-beta-go-get-it.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2009/01/08/windows-7-beta-go-get-it.aspx</id><published>2009-01-08T08:24:15Z</published><updated>2009-01-08T08:24:15Z</updated><content type="html">&lt;p&gt;Today during CES, Steve Ballmer announced and presented Windows 7 Beta and by &lt;b&gt;&lt;u&gt;this Friday&lt;/u&gt;&lt;/b&gt; it will be publicly available for download from &lt;a href="http://www.microsoft.com/windows/windows-7/"&gt;Windows 7 homepage&lt;/a&gt;. If you are MSDN Subscriber, you can &lt;a href="http://msdn.microsoft.com/subscriptions/downloads/default.aspx?pv=36:350"&gt;download Windows 7 Beta&lt;/a&gt; right now! &lt;a href="http://windowsteamblog.com/"&gt;Here are the instructions&lt;/a&gt; on how to download and install Windows 7 Beta.&lt;/p&gt;  &lt;p&gt;By making Windows 7 Beta publicly available we are hoping developers and enthusiasts will download it and the SDK, and will start testing this new Microsoft OS – Windows 7. Now that the beta is out and available, we can start engaging developers and can provide them with technical content so they can test and experiment with Windows 7. &lt;/p&gt;  &lt;p&gt;You already found this blog, the &lt;a href="http://blogs.msdn.com/yochay"&gt;Windows 7 Blog for Developers&lt;/a&gt;, so you are on the right track. Another awesome place to get great content is Channel 9, and specifically, &lt;a href="http://channel9.msdn.com/tags/Windows+7/"&gt;Windows 7 on Channel 9&lt;/a&gt;. Obviously, &lt;a href="http://msdn.microsoft.com/en-us/windows/default.aspx"&gt;Windows Development Center on MSDN&lt;/a&gt; is also a good place for Windows 7 technical content. You can also go to &lt;a href="http://devreadiness.org/"&gt;DevReadiness&lt;/a&gt; - a developer community site dedicated to assisting the Windows ISV ecosystem develop high quality applications for new versions of the platform.&lt;/p&gt;  &lt;p&gt;We are also starting a series of Channel 9 videos, and posts on specific topics such as the Windows 7 Taskbar, Windows 7 Ribbon, Sensors, and Location Platform, but this will have to wait for another day.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9293983" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author><category term="Windows 7" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7/" /><category term="Developers" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Developers/" /><category term="Microsoft" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Microsoft/" /><category term="CES" scheme="http://blogs.msdn.com/b/yochay/archive/tags/CES/" /><category term="Windows 7 Beta" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7+Beta/" /></entry><entry><title>Windows 7 Taskbar – Part 1, The Basics</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2009/01/06/windows-7-taskbar-part-1-the-basics.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2009/01/06/windows-7-taskbar-part-1-the-basics.aspx</id><published>2009-01-06T04:37:00Z</published><updated>2009-01-06T04:37:00Z</updated><content type="html">&lt;P&gt;This post is one of a series of Windows 7 Taskbar posts and webcasts. You can watch &lt;B&gt;&lt;A href="http://channel9.msdn.com/posts/yochay/Jump-into-the-Windows-7-Taskbar-Jump-Lists/" mce_href="http://channel9.msdn.com/posts/yochay/Jump-into-the-Windows-7-Taskbar-Jump-Lists/"&gt;Jump into the Windows 7 Taskbar Jump Lists&lt;/A&gt;&lt;/B&gt; webcast on Channel 9 for further technical information, or the &lt;STRONG&gt;&lt;A href="http://channel9.msdn.com/posts/yochay/Windows-7-New-Taskbar-an-overview/" mce_href="http://channel9.msdn.com/posts/yochay/Windows-7-New-Taskbar-an-overview/"&gt;entire Windows 7 Taskbar webcasts series&lt;/A&gt;&lt;/STRONG&gt;. You can also download the code sample.&lt;/P&gt;
&lt;P&gt;One of the first Windows 7 changes that developers should pay attention to is the new Windows Taskbar. This new feature introduces a functionality that developers need to understand so they can take full advantage of it in their own applications to better enhance their end users’ experiences.&lt;/P&gt;
&lt;P&gt;The new Taskbar is the most noticeable change to Windows 7 when you first log on. The Windows 7 Taskbar is an application-launching and window-switching mechanism that consolidates the functionalities from previous Windows Desktop mechanisms such as Quick Launch, Recent Documents, Notification area icons, desktop shortcuts, and running application windows. &lt;/P&gt;
&lt;P&gt;If you are unfamiliar with and haven’t seen any demonstrations of the Windows 7 Taskbar, please watch Chitnya’s online &lt;I&gt;Windows 7 Taskbar in Action&lt;/I&gt; demo during his &lt;A href="http://channel9.msdn.com/pdc2008/PC24/" mce_href="http://channel9.msdn.com/pdc2008/PC24/"&gt;Welcome to the New Desktop&lt;/A&gt; PDC session. This will give you some context for the technical material we are going to cover here. Additional information about the Windows 7 Taskbar can be found in &lt;A href="http://blogs.msdn.com/e7/archive/2008/11/20/happy-anniversary-windows-on-the-evolution-of-the-taskbar.aspx" mce_href="http://blogs.msdn.com/e7/archive/2008/11/20/happy-anniversary-windows-on-the-evolution-of-the-taskbar.aspx"&gt;The Windows 7 Taskbar&lt;/A&gt; E7 blog and in Channel 9&lt;A href="http://channel9.msdn.com/posts/yochay/Windows-7-New-Taskbar/" mce_href="http://channel9.msdn.com/posts/yochay/Windows-7-New-Taskbar/"&gt; Windows Taskbar Webcast series&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;In this article, we address Windows 7 Taskbar functionality and provide a high-level overview of its programming model to help developers to better prepare for Windows 7. Obviously, this will not be a comprehensive step-by-step developer guide to the Windows 7 Taskbar, but rather a broad overview. Please look for additional content about the Windows 7 taskbar in future posts. &lt;/P&gt;
&lt;P&gt;The Windows 7 Taskbar is designed to provide users with quick and easy access to those “things” they use all the time. “Things” can be any type of content such as pictures, music, word documents or links and shortcuts to applications or folders. By quick and easy access, we mean accessing commonly used programs with a single mouse click or significantly reducing the number of clicks per operation. Quick and easy access also means users should be able to “jump” directly to those things they want to work with and start working with them in a single mouse click. To provide this functionality, Windows 7 Taskbar introduces the concept of “Jump Lists.”&lt;/P&gt;
&lt;P&gt;As a developer, think of Jump Lists as your own mini Start Menu for &lt;A href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Windows7TaskbarPart1TheBasics_F7BD/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Windows7TaskbarPart1TheBasics_F7BD/image_2.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 5px 5px 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image align=right src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Windows7TaskbarPart1TheBasics_F7BD/image_thumb.png" width=124 height=240 mce_src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Windows7TaskbarPart1TheBasics_F7BD/image_thumb.png"&gt;&lt;/A&gt;your application. Jump Lists surface commonly used nouns (destinations) and verbs (tasks) of a program, enabling easy user access to destinations by eliminating the need to launch the application and then load the relevant content, or by performing common tasks without launching the application in advance. The following diagram illustrates how Jump Lists work with Microsoft Office Word. You can see that under the “Recent” category, there is a list of recent documents that I’ve used with Office Word. Clicking on one of the items in the “Recent” list will launch Office Word with the relevant document already loaded. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The out-of-the-box experience of the Jump Lists includes only the default &lt;I&gt;Taskbar Tasks.&lt;/I&gt; These provide the means to launch a new instance of the application, to pin or unpin an application to the taskbar, and to close the application. You can access the Jump List by right clicking on an application icon in the Taskbar. However, as the following diagram illustrates, you can opt into the Taskbar experience by customizing the context of the Jump Lists for your application.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Windows7TaskbarPart1TheBasics_F7BD/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Windows7TaskbarPart1TheBasics_F7BD/image_4.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://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Windows7TaskbarPart1TheBasics_F7BD/image_thumb_1.png" width=467 height=266 mce_src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/Windows7TaskbarPart1TheBasics_F7BD/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P align=center&gt;Image from Robert Jarrett’s slide deck from his PDC session&lt;/P&gt;
&lt;P&gt;Definitions from the Windows 7 SDK:&lt;/P&gt;
&lt;P&gt;”… &lt;B&gt;&lt;I&gt;Destinations&lt;/I&gt;&lt;/B&gt; are items that appear in the &lt;I&gt;Recent&lt;/I&gt;, &lt;I&gt;Frequent&lt;/I&gt; or custom categories (the “Important” category in the diagram above), based on the user’s items usage. Destination can be files, folders, Web sites or other content-based items, but are not necessarily file-backed. Destinations can be pinned to or removed from the Jump List by the user. They are generally represented by IShellItem objects, but they can also be IShellLink objects…”&lt;/P&gt;
&lt;P&gt;”…&lt;B&gt;&lt;I&gt;Tasks&lt;/I&gt;&lt;/B&gt; are common actions performed in applications that apply to all users of the application regardless of the individual usage patterns. Task can’t be pinned or removed. Tasks are represented by IShellLInk objects because they are actually links (with parameters – optional) to commands – “Actions”…”&lt;/P&gt;
&lt;P&gt;As developers, we can: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;B&gt;Control Application Destinations&lt;/B&gt; (that is control the items we want users to be able to “Jump” directly into and start working on) &lt;/LI&gt;&lt;/OL&gt;
&lt;UL&gt;
&lt;UL&gt;
&lt;LI&gt;Destinations can be any one of the known categories such as &lt;I&gt;Recent&lt;/I&gt; or &lt;I&gt;Frequent.&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;The &lt;I&gt;Custom&lt;/I&gt; category is just like any other Destination category, except that it allows developers to create a &lt;B&gt;new &lt;/B&gt;name for that category as well as populate it with items.&lt;/LI&gt;
&lt;LI&gt;The &lt;I&gt;Pinned&lt;/I&gt; category is provided for pinned items that users want to keep permanently in their Jump Lists.&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;2. &lt;B&gt;Define common user Tasks&lt;/B&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;UL&gt;
&lt;LI&gt;The Taskbar surfaces its own out-of-the-box tasks such as launching, pinning/unpinning, or closing the application. As developers we have no control over the Taskbar Tasks. However, we do control the User Tasks.&lt;/LI&gt;
&lt;LI&gt;User Tasks are common tasks the application developer wants to surface at the Jump List level that will enable users to perform a task directly from the Jump List (e.g. &lt;I&gt;Play all&lt;/I&gt; music in media player without switching to media player). Usually, this will result in launching an instance of the application and performing the task. Again, this saves time and reduces the number of clicks needed to achieve the same end goal without the Jump List functionality.&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;It is time we address the Taskbar programming model. The Taskbar exposes its set of APIs like any other Windows Shell component, through a set of COM interfaces. However, there are a few actions we developers can do even before starting to use the Windows Taskbar COM APIs. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Step 1 – Use the Out-of-the-Box Windows Experience and Default Behavior&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;By default, a Jump List contains a &lt;I&gt;Recent&lt;/I&gt; category that is populated automatically for file-based applications through the &lt;B&gt;&lt;I&gt;SHAddToRecentDocs&lt;/I&gt;&lt;/B&gt; function. This function adds the used “item” (document) to the Shell's list of recently used documents. In addition to updating its list of recent documents, the Shell adds a shortcut to the user's &lt;I&gt;Recent&lt;/I&gt; directory. The Windows 7 Taskbar uses that list and Recent directory to populate the list of recent items in the Jump Lists. &lt;/P&gt;
&lt;P&gt;Windows can also do the work for you if your application's file type has a registered handler (this does not have to be the default handler). Anytime you double click on a file type with a registered handler, before Windows launches your application it automatically calls &lt;B&gt;&lt;I&gt;SHAddToRecentDocs&lt;/I&gt;&lt;/B&gt; on your application's behalf. This inserts the item in the Windows Recent list and eventually into the Jump List Recent Category. The same automatic behavior occurs when using the Windows &lt;B&gt;common file dialog&lt;/B&gt; to open files through our applications.&lt;/P&gt;
&lt;P&gt;Both of the above cases exploit default Windows behavior in case you have a registered handler and an Application ID by which the files are assoctiated with &lt;I&gt;Recent&lt;/I&gt; and &lt;I&gt;Frequent&lt;/I&gt; lists. In both cases, Windows automatically inserts the items into the Jump Lists unless you &lt;B&gt;specifically&lt;/B&gt; remove this functionality by using the COM API. Obviously, users also have the option to remove any items from their Jump Lists. By explicitly removing an item from the Jump List, you insert it into the Removed item list, which we will discuss below. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Step 2 – Create Your Own Category &lt;/B&gt;&lt;/P&gt;
&lt;P&gt;If the default &lt;I&gt;Recent&lt;/I&gt; or &lt;I&gt;Frequent&lt;/I&gt; categories do not meet your application's needs, it is time to create your own &lt;I&gt;custom&lt;/I&gt; category. You need to use the ICustomDestinationList interface to create a custom Destination List.&lt;/P&gt;
&lt;P&gt;The ICustomDestinationList exposes methods that allow an application to provide a custom Jump List, including destinations and tasks, for display in the taskbar. Here are the methods that we are using for the example below:&lt;/P&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=169&gt;
&lt;P&gt;AppendCategory&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=469&gt;
&lt;P&gt;Defines a custom category and the destinations that it contains, for inclusion in a custom Jump List&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=169&gt;
&lt;P&gt;AppendKnownCategory&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=469&gt;
&lt;P&gt;Specifies that the Frequent or Recent category should be included in the Jump List&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=169&gt;
&lt;P&gt;BeginList&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=469&gt;
&lt;P&gt;Initiates a building session for a custom Jump List&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=169&gt;
&lt;P&gt;CommitList&lt;/P&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=469&gt;
&lt;P&gt;Declares that the Jump List initiated by a call to BeginList is complete and ready for display&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;Here is a code snippet for a function that creates a new custom list called “Custom Lists” and appends 4 items to it:&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   1:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;void&lt;/SPAN&gt; CreateJumpList()&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   2:  &lt;/SPAN&gt;{    &lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   3:  &lt;/SPAN&gt;    ICustomDestinationList *pcdl;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   4:  &lt;/SPAN&gt;    HRESULT hr = CoCreateInstance&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   5: &lt;/SPAN&gt;                    (CLSID_DestinationList, &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   6:   &lt;/SPAN&gt;                   NULL, CLSCTX_INPROC_SERVER, &lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   7:  &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; IID_PPV_ARGS(&amp;amp;pcdl));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   8:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   9:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (SUCCEEDED(hr))&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  10:  &lt;/SPAN&gt;    {&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  11:  &lt;/SPAN&gt;        hr = pcdl-&amp;gt;SetAppID(c_szAppID);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  12:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (SUCCEEDED(hr))&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  13:  &lt;/SPAN&gt;        {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  14:  &lt;/SPAN&gt;            UINT uMaxSlots;&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  15:  &lt;/SPAN&gt;            IObjectArray *poaRemoved;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  16:  &lt;/SPAN&gt;            hr = pcdl-&amp;gt;BeginList&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  17:  &lt;/SPAN&gt;                (&amp;amp;uMaxSlots, IID_PPV_ARGS(&amp;amp;poaRemoved));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  18:  &lt;/SPAN&gt;            &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (SUCCEEDED(hr))&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  19:  &lt;/SPAN&gt;            {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  20:  &lt;/SPAN&gt;                hr = _AddCategoryToList(pcdl, poaRemoved);&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  21:  &lt;/SPAN&gt;                &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (SUCCEEDED(hr))&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  22:  &lt;/SPAN&gt;                {&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  23:  &lt;/SPAN&gt;                    pcdl-&amp;gt;CommitList();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  24:  &lt;/SPAN&gt;                }&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  25:  &lt;/SPAN&gt;                poaRemoved-&amp;gt;Release();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  26:  &lt;/SPAN&gt;            }&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  27:  &lt;/SPAN&gt;        }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  28:  &lt;/SPAN&gt;    }&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  29:  &lt;/SPAN&gt;}&lt;/PRE&gt;&lt;/DIV&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;DIV class=csharpcode&gt;&lt;PRE class=alt&gt;&lt;SPAN class=rem&gt;// This is the helper function that actually &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=rem&gt;//appends the items to a collection object HRESULT &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class=alt&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;_AddCategoryToList(ICustomDestinationList *pcdl,&lt;/PRE&gt;&lt;PRE&gt;                       IObjectArray *poaRemoved)&lt;/PRE&gt;&lt;PRE class=alt&gt;{&lt;/PRE&gt;&lt;PRE&gt;    IObjectCollection *poc;&lt;/PRE&gt;&lt;PRE class=alt&gt;    HRESULT hr = CoCreateInstance&lt;/PRE&gt;&lt;PRE&gt;(CLSID_EnumerableObjectCollection, &lt;/PRE&gt;&lt;PRE class=alt&gt;NULL, &lt;/PRE&gt;&lt;PRE&gt;CLSCTX_INPROC_SERVER, &lt;/PRE&gt;&lt;PRE class=alt&gt;IID_PPV_ARGS(&amp;amp;poc));&lt;/PRE&gt;&lt;PRE&gt;    &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (SUCCEEDED(hr))&lt;/PRE&gt;&lt;PRE class=alt&gt;    {&lt;/PRE&gt;&lt;PRE&gt;        &lt;SPAN class=kwrd&gt;for&lt;/SPAN&gt; (UINT i = 0; i &amp;lt; ARRAYSIZE(c_rgpszFiles); i++)&lt;/PRE&gt;&lt;PRE class=alt&gt;        {&lt;/PRE&gt;&lt;PRE&gt;            IShellItem *psi;&lt;/PRE&gt;&lt;PRE class=alt&gt;            &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (SUCCEEDED(SHCreateItemInKnownFolder(&lt;/PRE&gt;&lt;PRE&gt;FOLDERID_Documents, &lt;/PRE&gt;&lt;PRE class=alt&gt;KF_FLAG_DEFAULT, &lt;/PRE&gt;&lt;PRE&gt;c_rgpszFiles[i], &lt;/PRE&gt;&lt;PRE class=alt&gt;IID_PPV_ARGS(&amp;amp;psi))))&lt;/PRE&gt;&lt;PRE&gt;            {&lt;/PRE&gt;&lt;PRE class=alt&gt;                &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt;(!_IsItemInArray(psi, poaRemoved))&lt;/PRE&gt;&lt;PRE&gt;                {&lt;/PRE&gt;&lt;PRE class=alt&gt;                    poc-&amp;gt;AddObject(psi);&lt;/PRE&gt;&lt;PRE&gt;                }&lt;/PRE&gt;&lt;PRE class=alt&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;                psi-&amp;gt;Release();&lt;/PRE&gt;&lt;PRE class=alt&gt;            }&lt;/PRE&gt;&lt;PRE&gt;        }&lt;/PRE&gt;&lt;PRE class=alt&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;        IObjectArray *poa;&lt;/PRE&gt;&lt;PRE class=alt&gt;        hr = poc-&amp;gt;QueryInterface(IID_PPV_ARGS(&amp;amp;poa));&lt;/PRE&gt;&lt;PRE&gt;        &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (SUCCEEDED(hr))&lt;/PRE&gt;&lt;PRE class=alt&gt;        {&lt;/PRE&gt;&lt;PRE&gt;            pcdl-&amp;gt;AppendCategory(L&lt;SPAN class=str&gt;"Custom category"&lt;/SPAN&gt;, poa);&lt;/PRE&gt;&lt;PRE class=alt&gt;            poa-&amp;gt;Release();&lt;/PRE&gt;&lt;PRE&gt;        }&lt;/PRE&gt;&lt;PRE class=alt&gt;        poc-&amp;gt;Release();&lt;/PRE&gt;&lt;PRE&gt;    }&lt;/PRE&gt;&lt;PRE class=alt&gt;    &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; hr;&lt;/PRE&gt;&lt;PRE&gt;}&lt;/PRE&gt;&lt;/DIV&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 mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We started with a call to CoCreateInstance to initialize the &lt;B&gt;ICustomDestinationList&lt;/B&gt; object (this is the joy of working with COM….). Next, we set the Application ID, so we could start populating items to the list. The Application ID is a string the uniquely identifies your application and make sure all the different windows are clustered under the same glom as well as all the files in the &lt;I&gt;Recent&lt;/I&gt; category, however, Application ID is important enough to get its own full blog in the near future.&lt;/P&gt;
&lt;P&gt;Using the &lt;B&gt;BeginList&lt;/B&gt; function initiated the build session for the custom Jump List. Note the &lt;B&gt;Remove&lt;/B&gt; item parameter, IObjectArray *poaRemoved, that the BeginList() returned as an out parameter. We will handle the removed items list below.&lt;/P&gt;
&lt;P&gt;Next we called a helper function, &lt;I&gt;_AddCategoryToList()&lt;/I&gt;, to do the actual work of adding items to the custom category. &lt;/P&gt;
&lt;P&gt;Another new interface, the IObjectCollection, represents a collection of objects that support &lt;B&gt;IUnKnown,&lt;/B&gt; to which we will add the IShellItems. Each item we added is of an &lt;I&gt;IShellItem&lt;/I&gt; type and we created each item in the documents known folder. However, before we actually added the new item to the collection, we needed to check if the user already removed it. If the user explicitly removed an item from the Jump List, that item will be in the &lt;I&gt;Removed Item List&lt;/I&gt; (again associated with the App ID), and, as developers, we need to respect the user's requests and avoid adding that item to the Jump List. We already have the list of removed items, IObjectArray *poaRemoved, that we got when we called the BeginList(…) function when we initiated the process of creating a new list. &lt;/P&gt;
&lt;P&gt;At this stage, we have a collection if IShellItems that the user expects to see in his Jump List. Next we added that collection to the ICustomDestinationList object and created a new category named “&lt;I&gt;Custom category&lt;/I&gt;”, pcdl-&amp;gt;AppendCategory (L"Custom category", poa);. &lt;/P&gt;
&lt;P&gt;We have successful created a new category in the Taskbar called “Custom category” and populated it with four items. However, our work is not done yet. The final step is to call the CommitList() function that ends the "transaction" that began with calling the BeginList() function. Only after our call to CommitList()&lt;B&gt; &lt;/B&gt;are&lt;B&gt; &lt;/B&gt;the new category and new items displayed. Calling CommitList() causes the stored list of removed items to be cleared and a new removed items list to begin. The ICustomDestinationist interface provides a "transactional base" API. In order to ensure a positive end user experience, make sure that a safe copy of the new repopulated list is complete and ready for use, and that the only operation the Taskbar must perform is to switch the pointer to the new list. &lt;/P&gt;
&lt;P&gt;As you can see, it is easy to opt in to the Windows 7 Taskbar functionality. Most of the work is performed automatically by Windows for you, and if you do need to create your own category, that is also very easy. &lt;/P&gt;
&lt;P&gt;There are many more features the new Windows 7 Taskbar that further enhance the user experience, including cool visual and informative notifications using Overlay icons, a Progress Bar indicator, and Thumbnail icons. We will address these features in future posts.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9284385" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author><category term="Windows 7" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7/" /><category term="Developers" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Developers/" /><category term="Code samples" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Code+samples/" /><category term="Windows 7 Beta" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7+Beta/" /><category term="Taskbar" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Taskbar/" /><category term="Channel 9" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Channel+9/" /></entry><entry><title>Laptop Power Conservation with Windows Bridge</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2008/12/02/laptop-power-conservation.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2008/12/02/laptop-power-conservation.aspx</id><published>2008-12-02T22:48:14Z</published><updated>2008-12-02T22:48:14Z</updated><content type="html">&lt;p&gt;In these days of ever-increasing mobile computing, laptop power consumption is ever more important. With laptops making up more than 50% of the computer sold last year, it is critical that users have all-day computing power when they're on the move. But paying attention to laptop power consumption is not important just for the user; increased use of battery-powered laptops results in lower IT power consumption costs. Computer usage is responsible for 7% to 18% of the electricity bill for a medium-sized company. While hardware providers are increasing battery life, It is critical that software developers don't inadvertently undercut those gains through their application's power draining practices. &lt;/p&gt;  &lt;p&gt;A very good PDC session by Pat Stemen, &lt;a href="http://channel9.msdn.com/pdc2008/PC02/"&gt;Extending Battery Life with Energy Efficient Applications&lt;/a&gt;, includes a detailed explanation of the technological improvements in Windows 7 and the tools that come with it. Power management in Windows 7 will be a topic for future blog posts. In this blog post we will look at Vista’s power management APIs and focus on the managed power wrapper in the new release of the &lt;a href="http://blogs.msdn.com/yochay/archive/2008/11/14/windows-vista-bridge-sample-library-a-managed-api-for-windows.aspx"&gt;Windows Vista Bridge Library&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There are a few steps that developers can take to reduce their applications’ power consumption. First, try to keep the application’s CPU usage as close to idle as possible at all times. (CPU idle state = CPU usage of less than 2%) When the CPU is in idle or close to idle state, the CPU enters a low-power state that reduces its clock frequency, resulting in significant battery power conservation. As developers, we can help maintain a low clock ratio by using events and asynchronous notifications rather than a timer to poll (query) a value. When an application polls at a high rate (high frequency), it increases CPU usage and power consumption. &lt;/p&gt;  &lt;p&gt;The following chart illustrates how increasing timer resolution&lt;a href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/LaptopPowerConservation_A4A7/CPU_Power_Timer_Resolution_2.png"&gt;&lt;img style="border-right-width: 0px; margin: 5px 0px 0px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CPU_Power_Timer_Resolution" border="0" alt="CPU_Power_Timer_Resolution" align="right" src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/LaptopPowerConservation_A4A7/CPU_Power_Timer_Resolution_thumb.png" width="235" height="330" /&gt;&lt;/a&gt; increases the power consumption. Changing the Windows default timer resolution from 15.6 milliseconds to 1 millisecond can result in an up to 20% impact on battery life, because the frequent timer interrupts will prevent the processor from entering low-power states. With the default timer resolution, the CPU power consumption can be low as 0.1 watts which is a fraction of the overall computer’s 11 watts power consumption. But when increasing the timer resolution to 1 millisecond, the CPU power consumption raises to 1.5 watts affecting the overall computer power consumption by 2 watts.&lt;/p&gt;  &lt;p&gt;Second, if an application launches a service that must wait for some event to happen, such as when a USB thumb drive is inserted, don’t launch the service until after the event occurs. It will be easy to implement this recommendation with the new Windows 7 Service Control Manager, which Vikram Singh presented during PDC in a session called &lt;a href="http://channel9.msdn.com/pdc2008/PC19/"&gt;Designing Efficient Background Processes&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Last, but by no means least, applications should be power aware. The power state of the computer can either be AC power, battery power, or UPS. To be power aware means that an application takes into account the current power state of the computer and acts upon that state in a way that minimizes power consumption. For example, an application should &lt;b&gt;&lt;u&gt;not&lt;/u&gt;&lt;/b&gt; start any non-critical operations while running on battery if it can postpone those operations to a later time without degrading the overall user experience. &lt;/p&gt;  &lt;p&gt;Clearly, power awareness is a critical step in optimizing application power demands. How do we ensure that our applications are power aware? &lt;/p&gt;  &lt;p&gt;To do this, we will use the Windows Vista Bridge Library. This library includes a whole section dedicated to bridging between the native power API and .NET. But there is one class within the library that is especially important for power aware managed code application. The &lt;strong&gt;&lt;font color="#408080"&gt;PowerManager&lt;/font&gt;&lt;/strong&gt; enables applications to register for power events and query the current power state. The &lt;strong&gt;&lt;font color="#408080"&gt;PowerManager&lt;/font&gt;&lt;/strong&gt; is a &lt;b&gt;static&lt;/b&gt; class that the application can use at any given time simply by accessing its properties. The &lt;strong&gt;&lt;font color="#408080"&gt;PowerManager&lt;/font&gt;&lt;/strong&gt; keeps its power state accurate at all times by running a thread in the background that listens to OS power events. This thread has minimum to no affect on the application power consumption.&lt;/p&gt;  &lt;p&gt;Here are some of the properties / functions that the &lt;strong&gt;&lt;font color="#408080"&gt;PowerManager&lt;/font&gt;&lt;/strong&gt; exposes regarding the power state:     &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;&lt;b&gt;Property or Function&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;PowerManager.PowerPersonality &lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;Specifies the the current power scheme&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;PowerManager.PowerSource&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;Specifies the power source currently supplying power to the system&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;PowerManager.IsBatteryPresent;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;True if battery is present (just if a laptop has one)&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;PowerManager.IsUpsPresent;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;Specifies whether power UPS is present&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;PowerManager.IsMonitorOn;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;Specifies whether the monitor is on&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;PowerManager.MonitorRequired;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;Specifies whether the monitor is set to remain active&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;PowerManager.IsBatteryShortTerm;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;Specifies whether the battery is a short term battery&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;PowerManager.BatteryLifePercent;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;Specifies the remaining battery life&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="313"&gt;           &lt;p&gt;PowerManager.GetCurrentBatteryState()&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="325"&gt;           &lt;p&gt;Gets a snapshot of the current battery state, nand updates the PowerManager&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;&lt;font color="#408080"&gt;PowerManager&lt;/font&gt;&lt;/strong&gt; also exposes set of events that an application can register in order to receive notifications when there is a change in the power status:     &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="321"&gt;           &lt;p&gt;&lt;b&gt;Event&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="318"&gt;           &lt;p&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="321"&gt;           &lt;p&gt;PowerManager. IsMonitorOnChanged;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="318"&gt;           &lt;p&gt;Raised when the monitor status changes&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="321"&gt;           &lt;p&gt;PowerManager.BatteryLifePercentChanged&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="318"&gt;           &lt;p&gt;Raised when the remaining battery life percentage changes&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="321"&gt;           &lt;p&gt;PowerManager.PowerPersonalityChanged&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="318"&gt;           &lt;p&gt;Raised each time the active power scheme changes&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="321"&gt;           &lt;p&gt;PowerManager. PowerSourceChanged&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="318"&gt;           &lt;p&gt;Raised when the power source changes&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="321"&gt;           &lt;p&gt;PowerManager.SystemBusyChanged&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="318"&gt;           &lt;p&gt;Raised when the system will not be moving into an idle state in the near future; applications should be designed to take advantage of this time to run their tasks, rather than running them during otherwise idle CPU periods&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;Note that Windows Vista and Windows 7 will always try to reach idle state; however, sometimes the system acknowledges that an idle state will not be reached anytime soon due to an IO or other operation. The OS can notify any interested applications that the system is “busy” and will not switch to an idle state anytime soon. This would allow the application to start running some tasks using the high utilization CPU as is.&lt;/p&gt;  &lt;p&gt;The Vista Bridge Library has an example showing how to use the &lt;strong&gt;&lt;font color="#408080"&gt;PowerManager&lt;/font&gt;&lt;/strong&gt; . It is a simple WPF application that uses the &lt;strong&gt;&lt;font color="#408080"&gt;PowerManager&lt;/font&gt;&lt;/strong&gt; to display the current power status and update the status upon power status change. When running the application you’ll see a simple window listing the &lt;strong&gt;&lt;font color="#408080"&gt;PowerManager&lt;/font&gt;&lt;/strong&gt; properties and the current power status. When switching from AC power to battery while running on a laptop you will notice the change to the Windows theme but also that the application has captured the power changes.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/LaptopPowerConservation_A4A7/VB_Power_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="VB_Power" border="0" alt="VB_Power" src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/LaptopPowerConservation_A4A7/VB_Power_thumb.png" width="461" height="245" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is the code snippet for capturing current power status: &lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; GetPowerSettings()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    settings.PowerPersonality = &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        PowerManager.PowerPersonality.ToString();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    settings.PowerSource = &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        PowerManager.PowerSource.ToString();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    settings.BatteryPresent = &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        PowerManager.IsBatteryPresent;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    settings.UpsPresent = &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        PowerManager.IsUpsPresent;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    settings.MonitorOn = &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        PowerManager.IsMonitorOn;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    settings.MonitorRequired = &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        PowerManager.MonitorRequired;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (PowerManager.IsBatteryPresent)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        settings.BatteryShortTerm = &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        PowerManager.IsBatteryShortTerm;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        settings.BatteryLifePercent = &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        PowerManager.BatteryLifePercent;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        settings.BatteryState = &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        PowerManager.GetCurrentBatteryState().ToString();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&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;&amp;#160;&lt;/p&gt;

&lt;p&gt;Here is the code snippet for registering to the events: &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="rem"&gt;// Adds event handlers for PowerManager events.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; CapturePowerManagementEvents()&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    PowerManager.IsMonitorOnChanged += &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; EventHandler(MonitorOnChanged);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    PowerManager.PowerPersonalityChanged += &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; EventHandler(PowerPersonalityChanged);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    PowerManager.PowerSourceChanged += &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; EventHandler(PowerSourceChanged);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (PowerManager.IsBatteryPresent)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            PowerManager.BatteryLifePercentChanged += &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                &lt;span class="kwrd"&gt;new&lt;/span&gt; EventHandler(BatteryLifePercentChanged);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    PowerManager.SystemBusyChanged += &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; EventHandler(SystemBusyChanged);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&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;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now it is up to you. Go ahead and download the &lt;a href="http://code.msdn.microsoft.com/VistaBridge"&gt;Windows Vista Bridge Sample Library&lt;/a&gt;, and start using Vista Power APIs - they all work just as well on a Windows 7 machine.&lt;/p&gt;

&lt;p&gt;(This blog and the application sample were written and tested on a Windows 7 machine)&lt;/p&gt;

&lt;p&gt;J&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9165862" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Windows Vista Bridge Sample Library = A Managed API for Windows</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2008/11/14/windows-vista-bridge-sample-library-a-managed-api-for-windows.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2008/11/14/windows-vista-bridge-sample-library-a-managed-api-for-windows.aspx</id><published>2008-11-14T03:41:00Z</published><updated>2008-11-14T03:41:00Z</updated><content type="html">&lt;P&gt;I am sure some of you are asking right now, “&lt;I&gt;Why are we writing and talking about Windows &lt;B&gt;Vista&lt;/B&gt; in the Windows 7® Blog for Developers?”&lt;/I&gt; The answer is simple. We are talking about &lt;A href="http://www.microsoft.com/windows/windows-vista/default.aspx" mce_href="http://www.microsoft.com/windows/windows-vista/default.aspx"&gt;Windows Vista&lt;/A&gt; because Windows 7 is based on the solid foundation of Windows Vista, and provides backward compatibility to the Windows Vista programming model. With that said, we are listening to customer feedback and making great improvements in regard to performance including better resource utilization, reliability, compatibility, and security, thereby perfecting the overall user experience while at the same time providing great value for developers. The &lt;A href="http://blogs.msdn.com/e7/archive/2008/08/27/windows-7-approach-to-system-performance.aspx" mce_href="http://blogs.msdn.com/e7/archive/2008/08/27/windows-7-approach-to-system-performance.aspx"&gt;Windows Engineering (E7) blog&lt;/A&gt; has a great post about this topic.&lt;/P&gt;
&lt;P&gt;It is no secret that the Windows Operating System (OS) is based on C / C++ and therefore uses a native programming model, most commonly known by its informal name &lt;B&gt;WinAPI&lt;/B&gt; or &lt;B&gt;Win32&lt;/B&gt; &lt;B&gt;API&lt;/B&gt;. The &lt;B&gt;Windows API&lt;/B&gt; is a &lt;U&gt;native C style or COM-based&lt;/U&gt; API. This makes using the API very easy and natural for native C /C++ developers. But what can we offer managed code developers? Are there any managed code APIs for Windows Vista or Windows 7? &lt;/P&gt;
&lt;TABLE border=0 cellSpacing=0 cellPadding=2 width=454&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=452&gt;The .NET Framework offers an easy and intuitive programming model targeting Windows clients (Web, servers, mobile, etc.) And, together with a set of tools and libraries, it provides a productive and effective framework for writing Windows client applications. One of the strengths of the .NET Framework is that it is a library-based framework, and anyone can add libraries to enhance the framework’s functionality. In fact, the out-of-the-box .NET experience offers a large number of libraries that abstracts the native Windows API, making development for a given Windows client (regardless of the OS version – XP, Vista, or 7) a much easier task than using the native Windows API.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;TABLE border=0 cellSpacing=0 cellPadding=2 width=453&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;A good example is the .NET WinForms assembly (assembly is .NET’s name for libraries), which contains a set of wrapper classes that wrap a traditional Win 32 API for creating and handling windows in the Windows OS. By abstracting the native API, .NET WinForms ensures that we don’t need to directly work with pointers (HWND) or handles (HINSTANCE) or other Windows native API constructs that could result in code that looks like this:&lt;/TD&gt;
&lt;TD vAlign=top width=251&gt;
&lt;P align=center&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 0px 0px 0px 5px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb.png" width=244 height=216 mce_src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;Rest assured, WinForms is HWND based. A .NET developer can easily access a given Windows form Handle or (HWND) by using the MSG.hwnd property that can be found in the System.Windows.Interop class in the WindowsBase assembly (WindowsBase.dll).&lt;/P&gt;
&lt;P&gt;But as comprehensive as the .NET Framework is, it does not offer managed APIs to all Windows’ native APIs. For example, a managed code developer doesn’t have any managed APIs to work with Windows Vista User Account Control (UAC) API, Restart Manager API, or the new Windows Vista Search API. These are just few examples of &lt;B&gt;&lt;U&gt;key&lt;/U&gt;&lt;/B&gt; native Windows APIs that .NET Framework doesn’t provide interfaces to and yet are crucial for a given application to successfully deploy on Windows while bringing excitement and innovations to end users. &lt;/P&gt;
&lt;P&gt;The &lt;A href="http://code.msdn.microsoft.com/VistaBridge" mce_href="http://code.msdn.microsoft.com/VistaBridge"&gt;Windows Vista Bridge Sample Library&lt;/A&gt; (VBSL) is an ongoing effort by the Microsoft SDK team to bridge between the .NET framework and the native Windows API. The VBSL is a class library that makes it much easier for managed developers to access light-up Windows Vista features with no need to worry about the Interop layer. Vista Bridge 1.3 provides managed developers with a set of classes, libraries, and samples written in .NET that allows developers to take advantage of Vista features including UAC, Power Management, Restart &amp;amp; Recovery, Restart Manager, Network, Aero Glass, among many others. It is important to say that all the Vista Bridge managed libraries work well with Windows 7 APIs and will continue to work in future release as the SDK team will continue to support this project.&lt;/P&gt;
&lt;P&gt;The Vista Bridge Sample Library (&lt;A href="http://code.msdn.microsoft.com/VistaBridge" mce_href="http://code.msdn.microsoft.com/VistaBridge"&gt;download Vista Bridge Sample Library&lt;/A&gt;) is part of the &lt;A href="http://blogs.msdn.com/windowssdk/archive/2008/10/11/using-windows-sdk-vista-bridge-sample-library.aspx" mce_href="http://blogs.msdn.com/windowssdk/archive/2008/10/11/using-windows-sdk-vista-bridge-sample-library.aspx"&gt;Windows SDK&lt;/A&gt;. However, this project is important enough to be placed front center in the Code Gallery. &lt;/P&gt;
&lt;P&gt;In future posts, we will drill into a few of the features mentioned above, mainly to show how you can take advantage of Windows Vista today in order to make the migration path to Windows 7 much easier in the future. &lt;/P&gt;
&lt;P&gt;One area where the VBSL can make a big difference is in dialogs. &lt;/P&gt;
&lt;P&gt;Windows Vista offers a wide variety of dialog boxes for different purposes. For examples, if you are using Windows Vista I am sure you are familiar this UI format:&lt;/P&gt;
&lt;P&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://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb_1.png" width=244 height=192 mce_src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb_1.png"&gt;&lt;/P&gt;
&lt;P&gt;Or with this one:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_6.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://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb_2.png" width=244 height=157 mce_src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Both of the above screenshots are fancy dialog boxes based on &lt;A href="http://msdn.microsoft.com/en-us/library/aa511455.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa511455.aspx"&gt;command links&lt;/A&gt;. With &lt;I&gt;command links&lt;/I&gt;, users select a single response to a main instruction and by doing so, move on to the next step in a task. Command links have a clean, lightweight appearance that allows for descriptive labels, and are displayed with either a standard arrow or custom icon, and an optional supplemental explanation.&lt;/P&gt;
&lt;P&gt;Here is an example of a typical set of command links.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_8.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://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb_3.png" width=465 height=294 mce_src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb_3.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Command links are similar to radio buttons in that they are used to select from a set of mutually exclusive, related choices. Like radio buttons, command links are always presented in sets, never individually. Command links have a lightweight appearance similar to regular links, without a frame or other strong click affordance. Command links are also similar to &lt;A href="http://msdn.microsoft.com/en-us/library/aa511453.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa511453.aspx"&gt;command buttons&lt;/A&gt;, in that they can be the default "command button" and they can have an access key assigned. Like &lt;A href="http://msdn.microsoft.com/en-us/library/aa511441.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa511441.aspx"&gt;commit buttons&lt;/A&gt;, when clicked they either close the window (for dialog boxes) or advance to the next page (for wizards and pages flows).&lt;/P&gt;
&lt;P&gt;Using the Windows Vista Bridge Sample Library, you can now create fancy Task Dialogs that look like this: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_9.png" mce_href="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_9.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://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb_4.png" width=376 height=312 mce_src="http://blogs.msdn.com/blogfiles/yochay/WindowsLiveWriter/WindowsVistaBridgeSampleLibraryAManagedA_E3E1/image_thumb_4.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The Task Dialog is an object in the Vista Bridge Sample Library, Microsoft.SDK.Samples.VistaBridge.Library.TaskDialog and has no design time properties; therefore, you must program the Dialog. But this is easy, as shown in the next examples.&lt;/P&gt;
&lt;P&gt;First, create a task dialog: TaskDialog td = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; TaskDialog();&lt;/P&gt;
&lt;P&gt;Then start setting its attributes, for example, caption, instructions, main content area, and the main icon: &lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=rem&gt;//main content section&lt;/SPAN&gt;
td.Caption = &lt;SPAN class=str&gt;"Fancy \"Vista\" Task Dialog on Win 7"&lt;/SPAN&gt;;
td.Instruction = &lt;SPAN class=str&gt;"Your instructions go here"&lt;/SPAN&gt;;
td.Content = &lt;SPAN class=str&gt;"Download Windows Vista Bridge Library"&lt;/SPAN&gt;;
td.MainIcon = TaskDialogStandardIcon.Information;&lt;/PRE&gt;
&lt;P&gt;Now add the optional footer text and footer icon: 
&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;PRE class=csharpcode&gt;td.FooterText = &lt;SPAN class=str&gt;"Footer text goes here"&lt;/SPAN&gt;;
td.FooterIcon = TaskDialogStandardIcon.Shield;&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;But the fun starts when you start playing with the TaskDialog.Controls, a collection of (you guessed it) TaskDialog controls &lt;FONT color=#006080&gt;DialogControlCollection&lt;/FONT&gt;&amp;lt;&lt;FONT color=#006080&gt;TaskDialogControl&lt;/FONT&gt;&amp;gt;.&lt;/P&gt;
&lt;P&gt;To which you can add TaskDialogControl objects:&lt;/P&gt;&lt;PRE class=csharpcode&gt;td.Controls.Add(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; TaskDialogCommandLink(&lt;SPAN class=str&gt;"new tdcl"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"main text here"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"instruction"&lt;/SPAN&gt;));&lt;/PRE&gt;
&lt;P&gt;In addition to adding Command Links, the Task Dialog also exposes a set of events that lets you manipulate and interact with users as they operate the dialog. The Task Dialog object exposes the &lt;B&gt;Tick&lt;/B&gt; event to work with the progress bar, &lt;B&gt;Open&lt;/B&gt;, and &lt;B&gt;Closing&lt;/B&gt; events, as well as &lt;B&gt;HelpInvoked&lt;/B&gt; and &lt;B&gt;HyperLinkClick&lt;/B&gt; to manage user requests for more information and help. &lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=rem&gt;//events that you can catch&lt;/SPAN&gt;
td.Tick += &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; EventHandler&amp;lt;TaskDialogTickEventArgs&amp;gt;(OnMyTick);
td.Opened += &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; EventHandler(OnOpenInvoked);
td.HelpInvoked += &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; EventHandler(OnHelpInvoked);&lt;/PRE&gt;
&lt;P&gt;You can also add Progress Bar, CheckBox, or Radio Button. Basically, the Windows Vista Task Dialogs API is a mini Dialog framework that saves you a lot of time dealing with wizards and fancy dialog screens. &lt;/P&gt;
&lt;P&gt;Now it is up to you. Go ahead and &lt;A href="http://code.msdn.microsoft.com/VistaBridge" mce_href="http://code.msdn.microsoft.com/VistaBridge"&gt;download the Windows Vista Bridge Sample Library&lt;/A&gt;, and start using Vista styles dialog—they all work just as well on a Windows 7 machine.&lt;/P&gt;
&lt;P&gt;(This blog was written on a Windows 7 machine)&lt;/P&gt;
&lt;P&gt;J&lt;/P&gt;
&lt;P&gt;The code for the examples above&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   1:  &lt;/SPAN&gt;td = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; TaskDialog();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   2:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   3:  &lt;/SPAN&gt;&lt;SPAN class=rem&gt;//&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   4:  &lt;/SPAN&gt;td.StartupLocation = TaskDialogStartupLocation.CenterOwner;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   5:  &lt;/SPAN&gt;td.Cancelable = &lt;SPAN class=kwrd&gt;true&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   6:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   7:  &lt;/SPAN&gt;&lt;SPAN class=rem&gt;//main content section&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   8:  &lt;/SPAN&gt;td.Caption = &lt;SPAN class=str&gt;"Fancy \"Vista\" Task Dialog on Win 7"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   9:  &lt;/SPAN&gt;td.Instruction = &lt;SPAN class=str&gt;"Your instructions go here"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  10:  &lt;/SPAN&gt;td.Content = &lt;SPAN class=str&gt;"Download Windows Vista Bridge Library Sample"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  11:  &lt;/SPAN&gt;td.MainIcon = TaskDialogStandardIcon.Information;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  12:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  13:  &lt;/SPAN&gt;&lt;SPAN class=rem&gt;//setting footer content&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  14:  &lt;/SPAN&gt;td.FooterText = &lt;SPAN class=str&gt;"Footer text goes here"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  15:  &lt;/SPAN&gt;td.FooterIcon = TaskDialogStandardIcon.Shield;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  16:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  17:  &lt;/SPAN&gt;&lt;SPAN class=rem&gt;//Command Links&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  18:  &lt;/SPAN&gt;td.Controls.Add(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; TaskDialogCommandLink(&lt;SPAN class=str&gt;"new tdcl"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"Main text here"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"Instruction"&lt;/SPAN&gt;));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  19:  &lt;/SPAN&gt;td.Controls.Add(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; TaskDialogCommandLink&lt;/PRE&gt;&lt;PRE&gt;          (&lt;SPAN class=str&gt;"Another new tdcl"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;" Another main text here"&lt;/SPAN&gt;, &lt;SPAN class=str&gt;"More instruction"&lt;/SPAN&gt;));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  20:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  21:  &lt;/SPAN&gt;&lt;SPAN class=rem&gt;//Expanding &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  22:  &lt;/SPAN&gt;td.ExpansionMode = TaskDialogExpandedInformationLocation.ExpandContent;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  23:  &lt;/SPAN&gt;td.ExpandedControlText = &lt;SPAN class=str&gt;"Expanded Control Text"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  24:  &lt;/SPAN&gt;td.ExpandedText = &lt;SPAN class=str&gt;"This is some expanded text, only visible when expanded"&lt;/SPAN&gt;; &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  25:  &lt;/SPAN&gt;td.CollapsedControlText = &lt;SPAN class=str&gt;"Collapsed Control Text"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  26:  &lt;/SPAN&gt;td.HyperlinksEnabled = &lt;SPAN class=kwrd&gt;true&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  27:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  28:  &lt;/SPAN&gt;&lt;SPAN class=rem&gt;//Prograss Bar&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  29:  &lt;/SPAN&gt;TaskDialogProgressBar tdpb = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; TaskDialogProgressBar();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  30:  &lt;/SPAN&gt;tdpb.Name = &lt;SPAN class=str&gt;"myPrograssBar1"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  31:  &lt;/SPAN&gt;tdpb.Minimum = 0;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  32:  &lt;/SPAN&gt;tdpb.Maximum = 100;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  33:  &lt;/SPAN&gt;td.ProgressBar = tdpb; &lt;SPAN class=rem&gt;//adding to main Task Dialog&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  34:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  35:  &lt;/SPAN&gt;&lt;SPAN class=rem&gt;// Check Box&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  36:  &lt;/SPAN&gt;td.CheckBoxChecked = &lt;SPAN class=kwrd&gt;true&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  37:  &lt;/SPAN&gt;td.CheckBoxText = &lt;SPAN class=str&gt;"This is a checkbox, we can register to listen for its events"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  38:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  39:  &lt;/SPAN&gt;&lt;SPAN class=rem&gt;//events that you can catch&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  40:  &lt;/SPAN&gt;td.Tick += &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; EventHandler&amp;lt;TaskDialogTickEventArgs&amp;gt;(OnMyTick);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  41:  &lt;/SPAN&gt;td.Opened += &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; EventHandler(OnOpenInvoked);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  42:  &lt;/SPAN&gt;td.HelpInvoked += &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; EventHandler(OnHelpInvoked);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  43:  &lt;/SPAN&gt;td.Closing += &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; EventHandler&amp;lt;TaskDialogClosingEventArgs&amp;gt;(OnDialogClosing);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  44:  &lt;/SPAN&gt;td.HyperlinkClick += &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; EventHandler&amp;lt;TaskDialogHyperlinkClickedEventArgs&amp;gt;(td_HyperlinkClick);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  45:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  46:  &lt;/SPAN&gt;td.Show(); &lt;/PRE&gt;&lt;/DIV&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;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9068015" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author><category term="Windows 7" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7/" /><category term="Developers" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Developers/" /><category term="Code samples" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Code+samples/" /><category term="Code examples" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Code+examples/" /><category term="Windows Vista Brdige Sample Library" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+Vista+Brdige+Sample+Library/" /><category term="Windows Vista" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+Vista/" /></entry><entry><title>Windows 7 at PDC – Part 2 (post Windows 7 announcement)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2008/10/28/windows-7-at-pdc-part-2-post-windows-7-announcement.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2008/10/28/windows-7-at-pdc-part-2-post-windows-7-announcement.aspx</id><published>2008-10-28T22:10:18Z</published><updated>2008-10-28T22:10:18Z</updated><content type="html">&lt;p&gt;With Windows 7 unveiled during PDC Day 2 keynote we update few of Windows 7 sessions that had a &lt;b&gt;TBD&lt;/b&gt; abstract as well &lt;b&gt;adding two new sessions&lt;/b&gt;. Hereunder is the list of updated sessions and the new session. &lt;/p&gt;  &lt;p&gt;PDC full session list can be found &lt;a href="https://sessions.microsoftpdc.com/public/timeline.aspx"&gt;here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;PC16 Windows 7: Empower users to find, visualize and organize their data with Libraries and the Explorer &lt;/b&gt;(updated session)&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Presenter: &lt;b&gt;David Washington&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Learn how you can enable a familiar experience for users and light up your application by using the Windows Search API and Library API and File Dialog. Also learn how you can integrate your web service with Windows search by using the OpenSearch standard without writing any client code. Master how to provide a rich experience for your data type in the Windows 7 Explorer with metadata, thumbnails, verbs and previews.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;ES20 Developing Applications for More Than 64 Logical Processors in Windows Server 2008 R2 &lt;/b&gt;(new session)&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Presenter: &lt;b&gt;Arie van der Hoeven &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Windows 7 will support more than 64 logical processors with improved kernel scheduler mechanisms that enable efficient scaling. Learn how to use new system software affinity APIs to aid application scalability beyond 64 logical processors through the use of &amp;quot;Kernel Groups.&amp;quot; Kernel Groups allow for legacy processor affinity aware applications to perform well while applications and drivers using new APIs can take advantage of all processors on the system.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;PC25 Windows 7: The Sensor and Location Platform: Building Context-Aware Applications&lt;/b&gt; (updated session)&lt;/p&gt;  &lt;p&gt;Presenter: Dan Polivy&lt;/p&gt;  &lt;p&gt;Windows 7 introduces a platform for using sensor devices, such as light sensors or GPS sensors, to create environmental or location awareness in programs. In this session, you will learn how to use sensors to make your programs more functional, easier to use, and more aware of the surrounding environment&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;PC14 Windows 7: New Shell User Experience APIs&lt;/b&gt; (Updated session)&lt;/p&gt;  &lt;p&gt;Presenter: &lt;b&gt;Nicolas Brun&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This session dives into new APIs that enable integration with the latest Windows desktop features. Learn about new extensibility methods to surface your application's key tasks. Discover how enhancements to the taskbar, Start Menu, thumbnails and their desktop elements provide new ways for you to delight your users. This talk is a must for application developers who want to provide the best user experience for their applications on Windows 7.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;PC13 Windows 7: Building Great Audio Communications Applications &lt;/b&gt;(Updated session)&lt;/p&gt;  &lt;p&gt;Presenter: &lt;b&gt;Larry Osterman&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Using the PC as a phone is central to the future of communications, and this session will provide you with the essentials to build the end to end experience. Windows 7 provides APIs for integrating communications capabilities into your applications. This session covers attenuating and muting sounds during a phone call, receiving a phone call using a Bluetooth headset, improving the latency of a phone call, and selecting the appropriate communications device.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;ES26 Windows Server 2008 R2: Using Classification for File Lifecycle Management &lt;/b&gt;(New session)&lt;/p&gt;  &lt;p&gt;Presenters: &lt;b&gt;Nir Ben Zvi, Matthias Wollnik&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Windows File Server 2008 R2 provides a new extensible infrastructure to manage files based on classification. These capabilities can be leveraged by backup products, archival and workflow management software, and tools that help prevent information leakage. See how both on-premises software and software plus services developers can take advantage of these new capabilities to deliver end-to-end solutions with integrated classification capabilities.&lt;/p&gt;  &lt;p&gt;J&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9020757" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author><category term="Windows 7" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7/" /><category term="Developers" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Developers/" /><category term="Microsoft" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Microsoft/" /><category term="PDC08" scheme="http://blogs.msdn.com/b/yochay/archive/tags/PDC08/" /><category term="PDC 2008" scheme="http://blogs.msdn.com/b/yochay/archive/tags/PDC+2008/" /></entry><entry><title>Windows 7 Developer Guide Is Now Available</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/yochay/archive/2008/10/28/windows-7-developer-guide-is-available.aspx" /><id>http://blogs.msdn.com/b/yochay/archive/2008/10/28/windows-7-developer-guide-is-available.aspx</id><published>2008-10-28T21:38:02Z</published><updated>2008-10-28T21:38:02Z</updated><content type="html">&lt;p&gt;With Windows 7 unveiled during PDC Day 2 keynote, we also released &lt;a href="http://code.msdn.microsoft.com/Win7DeveloperGuide"&gt;Windows 7 Developer Guide&lt;/a&gt;. This is relatively a short guide outlining some of Windows 7’s main features as well highlighting the solid foundations Windows 7 is build upon. The goal of this document is to help developers plan for the near future by providing developers a clear picture of Windows 7’s new capabilities, and the scenarios developers can target in order to enhance their end users experiences for Windows 7 applications. For example, &lt;strong&gt;Scenic Ribbon &lt;/strong&gt;(&lt;a href="http://channel9.msdn.com/pdc2008/PC14/"&gt;view at PDC&lt;/a&gt; ), &lt;strong&gt;Multi-Touch &lt;/strong&gt;(&lt;a href="http://channel9.msdn.com/pdc2008/PC03/"&gt;view at PDC&lt;/a&gt; ), &lt;strong&gt;Libraries &lt;/strong&gt;(&lt;a href="http://channel9.msdn.com/pdc2008/PC16/"&gt;view at PDC&lt;/a&gt; ), and &lt;strong&gt;Sensors and Locations &lt;/strong&gt;(&lt;a href="http://channel9.msdn.com/pdc2008/PC25/"&gt;view at PDC&lt;/a&gt; ) are just few of Windows 7’s features developers can use to enhance their end users experiences. Please note, this document is &lt;b&gt;not&lt;/b&gt; a full blown detailed description of the new APIs in Windows 7. In fact, this document does not contain any API references or code examples. All that good stuff will arrive sometime in the near future in future posts.&lt;/p&gt;  &lt;p&gt;As you read through the developer guide you’ll notice three main parts: &lt;b&gt;Solid Foundation&lt;/b&gt;, &lt;b&gt;Richer Application Experiences&lt;/b&gt;, and &lt;b&gt;The Best of Windows and the Web&lt;/b&gt;. Following that path while developing applications for Windows 7 is a very good practice, as Windows 7 leverages Windows Vista’s features and concepts. Next you can enhance your end user experiences with Ribbon, Multi-Touch, or integrating with Windows 7 new Taskbar (or any of other Windows 7 features). Finally, providing new services or leveraging exciting services that interact with your application add a whole new set of experiences for your end users. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;Solid Foundation&lt;/u&gt;&lt;/b&gt;&lt;u&gt; &lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Windows 7 provides a highly productive developer platform and tools that deliver on core operating system fundamentals. Windows 7 builds upon the Windows Vista platform, giving developers the power to build applications that are &lt;b&gt;compatible with both platforms&lt;/b&gt; while limiting application compatibility issues. Windows 7 dramatically improves performance and power management so that you can create applications that optimize the mobile experience. As a result, your applications will be more visually appealing, easier to create, and support a wider range of international standards. Advances have also been made in global support, accessibility, and application deployment…. (Read more in the &lt;a href="http://code.msdn.microsoft.com/Win7DeveloperGuide"&gt;Windows 7 Developer Guide&lt;/a&gt;)&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;Richer Application Experiences&lt;/u&gt;&lt;/b&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Windows 7 enables developers to create distinctive and intuitive applications that significantly enhance discoverability, usability, and sheer enjoyment. New methods of desktop integration &lt;b&gt;put application functionality right at the user’s fingertips&lt;/b&gt;, and Windows Explorer and Libraries provide easy access to high-value information. The Scenic Ribbon control and animation framework make it easier to build interactive and appealing user interfaces. New touch APIs enable natural interactions through multi-touch and finger-panning, and manipulation and inertia APIs enable impressive visual effects… (Read more in the &lt;a href="http://code.msdn.microsoft.com/Win7DeveloperGuide"&gt;Windows 7 Developer Guide&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;The Best of Windows and the Web&lt;/u&gt;&lt;/b&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;With Windows 7, it’s easy to get connected and stay connected. Windows networking offers developers options for better caching and sharing of data to improve network performance. Network diagnostics in Windows 7 give developers relevant information for monitoring network issues. Whether the goal is to connect devices, connect to a network, or simply understand the status of your connection, Windows 7 provides an enhanced platform… (Read more in the &lt;a href="http://code.msdn.microsoft.com/Win7DeveloperGuide"&gt;Windows 7 Developer Guide&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;J&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9020689" width="1" height="1"&gt;</content><author><name>yochayk</name><uri>http://blogs.msdn.com/yochayk/ProfileUrlRedirect.ashx</uri></author><category term="Windows 7" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7/" /><category term="Microsoft" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Microsoft/" /><category term="Windows 7 Developer Guide" scheme="http://blogs.msdn.com/b/yochay/archive/tags/Windows+7+Developer+Guide/" /></entry></feed>