<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://windowsteamblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Windows Mobile Developer Blog</title><link>http://windowsteamblog.com/blogs/wmdev/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>Windows Marketplace for Mobile: Advanced Anti-Piracy Protection</title><link>http://windowsteamblog.com/blogs/wmdev/archive/2010/01/15/windows-marketplace-for-mobile-advanced-anti-piracy-protection.aspx</link><pubDate>Fri, 15 Jan 2010 23:16:52 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:531806</guid><dc:creator>Mike Francis</dc:creator><slash:comments>20</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/wmdev/rsscomments.aspx?PostID=531806</wfw:commentRss><comments>http://windowsteamblog.com/blogs/wmdev/archive/2010/01/15/windows-marketplace-for-mobile-advanced-anti-piracy-protection.aspx#comments</comments><description>&lt;p&gt;If you are developing applications for Windows phone, you have probably read about the Standard and Advanced Anti-Piracy Protection available to developers to help protect your hard developed IP. If you haven’t done so yet, check out the Windows Marketplace anti-piracy model white paper available &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=7baaf9b9-bd1f-4a51-9d21-4a65dbbc8419"&gt;here&lt;/a&gt;. Advanced Anti-Piracy Protection (AAPP) is designed to thwart the illegitimate sharing of your Windows phone applications. Even if a hacker obtains the binaries from one device, AAPP will prevent that application from running on any other device. While Standard Anti-Piracy protection does not require any intervention by the developer, AAPP does require that you integrate code into your application. We will walk through how AAPP works, how you obtain the AAPP code from Microsoft and how to integrate the AAPP code into your application.&lt;/p&gt;  &lt;h4&gt;How Advanced Anti-Piracy Protection works&lt;/h4&gt;  &lt;p&gt;Installation Time: &lt;em&gt;The Marketplace Client installs a license, derived from the application id and the device id, into the registry. The license is protected using &lt;/em&gt;&lt;a href="http://en.wikipedia.org/wiki/RSA"&gt;&lt;em&gt;RSA&lt;/em&gt;&lt;/a&gt;&lt;em&gt; security.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Application Run Time: &lt;em&gt;The startup code (obtained from the &lt;a href="http://developer.windowsphone.com/Marketplace.aspx"&gt;Marketplace&lt;/a&gt; section of the &lt;a href="http://developer.windowsphone.com"&gt;Windows phone Developer Portal&lt;/a&gt;) in your application verifies that the license stored in the registry matches your application. You (the developer) has control over the error handling. You can choose to display an error and quit, shift into ‘demo’ mode, or do whatever you deem appropriate. &lt;/em&gt;&lt;/p&gt;  &lt;h4&gt;How to obtain the AAPP Code&lt;/h4&gt;  &lt;p&gt;Obtaining the AAPP code is part of the application submission process. You will see the following at Step 3 (Product Info). &lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/image6_5F00_197B8F5B.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/image6_5F00_thumb_5F00_18A32971.png" width="932" height="217" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Clicking on ‘&lt;strong&gt;Show Managed Code…’&lt;/strong&gt; we see the following code:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:55ae5e2d-ce96-444d-91d3-1c77ae986060" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 500px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;using&lt;/span&gt; System.Runtime.InteropServices;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;using&lt;/span&gt; System.Security.Cryptography;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;using&lt;/span&gt; System.Text;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;// ....&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; m_certModulus = &lt;span style="color:#a31515"&gt;&amp;quot;a26T2aaMKaafWSaI5JOaaQ7...&amp;quot;&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; m_certExponent = &lt;span style="color:#a31515"&gt;&amp;quot;DUPQ&amp;quot;&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; m_appSku = &lt;span style="color:#a31515"&gt;&amp;quot;dddddddd-70e8-4b15-9c90-46fca72d6959&amp;quot;&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;[&lt;span style="color:#2b91af"&gt;DllImport&lt;/span&gt;(&lt;span style="color:#a31515"&gt;&amp;quot;coredll.dll&amp;quot;&lt;/span&gt;)]&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; GetDeviceUniqueID([&lt;span style="color:#2b91af"&gt;In&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;Out&lt;/span&gt;] &lt;span style="color:#0000ff"&gt;byte&lt;/span&gt;[] appdata,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; cbApplictionData,&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; dwDeviceIDVersion,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    [&lt;span style="color:#2b91af"&gt;In&lt;/span&gt;, &lt;span style="color:#2b91af"&gt;Out&lt;/span&gt;] &lt;span style="color:#0000ff"&gt;byte&lt;/span&gt;[] deviceIDOuput,&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;out&lt;/span&gt; &lt;span style="color:#0000ff"&gt;uint&lt;/span&gt; pcbDeviceIDOutput);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; Main()&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;//Pre-Initialization code&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#008000"&gt;// ....&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;byte&lt;/span&gt;[] licenseBytes = &lt;/li&gt; &lt;li&gt;    Microsoft.Win32.Registry.CurrentUser.OpenSubKey(&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&amp;quot;Security&amp;#92;&amp;#92;Software&amp;#92;&amp;#92;Microsoft&amp;#92;&amp;#92;Marketplace&amp;#92;&amp;#92;Licenses&amp;#92;&amp;#92;&amp;quot;&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;    .GetValue(m_appSku) &lt;span style="color:#0000ff"&gt;as&lt;/span&gt; &lt;span style="color:#0000ff"&gt;byte&lt;/span&gt;[];&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; data = m_appSku.ToLower() + &lt;span style="color:#a31515"&gt;&amp;quot; &amp;quot;&lt;/span&gt; + GetUniqueDeviceID();&lt;/li&gt; &lt;li&gt;RSACryptoServiceProvider rsa = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; RSACryptoServiceProvider();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;//Create a new instance of RSAParameters.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;RSAParameters RSAKeyInfo = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; RSAParameters();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;//Set RSAKeyInfo to the public key values. &lt;/span&gt;&lt;/li&gt; &lt;li&gt;RSAKeyInfo.Modulus = Convert.FromBase64String(m_certModulus);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;RSAKeyInfo.Exponent = Convert.FromBase64String(m_certExponent);&lt;/li&gt; &lt;li&gt;rsa.ImportParameters(RSAKeyInfo);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;byte&lt;/span&gt;[] bData = System.Text.Encoding.ASCII.GetBytes(data);&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;null&lt;/span&gt; == licenseBytes || &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    !rsa.VerifyData(bData, &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; SHA1CryptoServiceProvider(), &lt;/li&gt; &lt;li&gt;    licenseBytes))&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    MessageBox.Show(&lt;span style="color:#a31515"&gt;&amp;quot;Could not verify signature&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;else&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    MessageBox.Show(&lt;span style="color:#a31515"&gt;&amp;quot;License is valid!&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;li&gt;&lt;span style="color:#008000"&gt;// ...&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;// Post-initialization code&lt;/span&gt;&lt;/li&gt; &lt;li&gt;Application.Run(&lt;span style="color:#0000ff"&gt;new&lt;/span&gt; Form1());&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; GetUniqueDeviceID()&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;// Call the GetDeviceUniqueID&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;byte&lt;/span&gt;[] appData = Encoding.Unicode.GetBytes(&lt;span style="color:#a31515"&gt;&amp;quot;Marketplace&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt; appDataSize = appData.Length;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;byte&lt;/span&gt;[] outData = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff"&gt;byte&lt;/span&gt;[20];&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;uint&lt;/span&gt; outSize = 20;&lt;/li&gt; &lt;li&gt;GetDeviceUniqueID(appData, appDataSize, 1, outData, &lt;span style="color:#0000ff"&gt;out&lt;/span&gt; outSize);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;StringBuilder resultSB = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; StringBuilder();&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;byte&lt;/span&gt; b &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; outData)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;resultSB.Append(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515"&gt;&amp;quot;{0:x2}&amp;quot;&lt;/span&gt;, b));&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;return&lt;/span&gt; resultSB.ToString();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;p&gt;&lt;/p&gt;  &lt;h4&gt;Integrating AAPP Code into your Application&lt;/h4&gt;  &lt;p&gt;This code has all the basics you need to implement the Advanced Anti-Piracy Protection. However there are a few gaps that you need to fill-in. I’ve put together a sample (&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/windowsphone/HelloAAPP.zip"&gt;HelloAAPP&lt;/a&gt;) that has these issues worked out.&amp;#160; You can download it from &lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/windowsphone/HelloAAPP.zip"&gt;here&lt;/a&gt;. &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The code provided by the portal does not catch NullReferenceException thrown by the Registry class if the license key cannot be found. This is most commonly caused by installing the CAB outside of the Marketplace client. This is because during installation, the Marketplace client installs the license into the registry. Most often you will see this during your own ad hoc testing. To help you avoid this error, in Debug mode, the sample installs a test license into the registry. Additionally the sample includes a handler for this exception. &lt;/li&gt;    &lt;li&gt;In the portal code, if the validation succeeds or fails, the application will still run. In most cases you will want to notify the user and exit. The sample displays an error message and the application exits following the users response. &lt;/li&gt;    &lt;li&gt;In the portal code, if the validation succeeds, the code will notify the user telling them so. This notification is probably not necessary in a real world scenario. The sample simply continues if the validation succeeds. Note that in the sample the same validation (VerifyData) is called in both Debug and Release modes. In Debug mode the test license is validated using the test key. In Release mode the real license is validated using the public key included in the developer portal code. &lt;/li&gt;    &lt;li&gt;In the portal code, the error message does not have any context. A (hopefully) clearer message “&lt;strong&gt;License verification failed. Please install via Windows Marketplace for Mobile.” &lt;/strong&gt;is used in the sample. &lt;/li&gt;    &lt;li&gt;In the portal code, there is no way to test the validation logic since there is currently no way to install a license. As mentioned above, the sample creates and uses a test license that tests the validation logic. This goal of the sample is to demonstrate a way to use a test license in Debug mode and a real license in Release mode with all other code being the same. &lt;/li&gt;    &lt;li&gt;The error message is not localized. In the sample, the message is localized in English and German (de-DE). &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Please let me know in the comments if there any other gaps in the AAPP code that you have had to fill. &lt;/p&gt;  &lt;p&gt;Thanks,&lt;/p&gt;  &lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=531806" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/marketplace/default.aspx">marketplace</category><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/windowsmobile/default.aspx">windowsmobile</category><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/Security/default.aspx">Security</category></item><item><title>New Windows Mobile Developer Certificates</title><link>http://windowsteamblog.com/blogs/wmdev/archive/2010/01/12/new-windows-mobile-developer-certificates.aspx</link><pubDate>Tue, 12 Jan 2010 19:43:52 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:531644</guid><dc:creator>Roshan Khan</dc:creator><slash:comments>21</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/wmdev/rsscomments.aspx?PostID=531644</wfw:commentRss><comments>http://windowsteamblog.com/blogs/wmdev/archive/2010/01/12/new-windows-mobile-developer-certificates.aspx#comments</comments><description>&lt;p&gt;As of 12/31/2009 the test certificates that shipped with the Windows Mobile SDK expired. However, we’ve gone ahead and generated new certificates that you can drop in to rectify this problem.&lt;/p&gt;  &lt;p&gt;If you’re a developer you can put these certificates right into Visual Studio (or sign via command line). If you’re a tester, you can follow these &lt;a href="http://technet.microsoft.com/en-us/library/cc182301.aspx"&gt;instructions&lt;/a&gt; to create a provisioning file for a device, so that you don’t need Visual Studio to push certificates onto test platforms.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/WM65Certs.zip"&gt;Download new certificates here.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=531644" width="1" height="1"&gt;</description></item><item><title>Windows Marketplace for Mobile – a Worldwide Marketplace for Developers</title><link>http://windowsteamblog.com/blogs/wmdev/archive/2009/11/18/windows-marketplace-for-mobile-a-worldwide-marketplace-for-developers.aspx</link><pubDate>Wed, 18 Nov 2009 11:35:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:528900</guid><dc:creator>Frank Prengel</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/wmdev/rsscomments.aspx?PostID=528900</wfw:commentRss><comments>http://windowsteamblog.com/blogs/wmdev/archive/2009/11/18/windows-marketplace-for-mobile-a-worldwide-marketplace-for-developers.aspx#comments</comments><description>&lt;p&gt;Hello there, my name is &lt;a href="http://blogs.msdn.com/frankpr"&gt;Frank Prengel&lt;/a&gt;, and I&amp;rsquo;m a technical evangelist at Microsoft Germany, helping the Windows phone and Marketplace teams establish &lt;a href="http://marketplace.windowsphone.com/"&gt;Windows Marketplace for Mobile&lt;/a&gt; in my country. Since I work with the German developer &amp;amp; ISV community, let me share with you some thoughts from a local perspective &amp;ndash; they may help you develop for Marketplace, especially if you live outside the US. &lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s first remember that Windows Mobile has always had a very active developer community, and that it gives you freedom in how software is developed and distributed. There are more than 20,000 Windows Mobile applications today which you can get and install from Web sites, software portals, forums, etc. &amp;ndash; provided you are a tech savvy person, and you know how to do it. With Windows Mobile 6.5 we have begun addressing non-tech savvy consumers as well. This is exactly why we introduced Windows Marketplace for Mobile as an easy way for people to find and install additional software on their new Windows phones. &lt;/p&gt;
&lt;p&gt;If you are a developer, this means one thing for you: an &lt;i&gt;additional&lt;/i&gt; great opportunity to potentially reach millions of new customers. Windows Marketplace launched with commerce in 20 markets as well as developer registration support in 29 markets, more than any other app store at launch. It offers credit card as well as mobile operator billing, and self-serve refunds of certified apps. It now supports Windows Mobile 6 and 6.1 and even allows for browsing and purchasing apps from the PC, with over-the-air synchronization to the user&amp;rsquo;s Windows phone. If your goal is to expand your business or the reach of your software, you should take the opportunity to join. For more information on the recent Windows Marketplace updates, including availability on 6 and 6.1, accessibility to browse and purchase apps from the PC and antipiracy protection benefits for developers, check out Todd Brix&amp;rsquo;s blog post at the &lt;a href="http://windowsteamblog.com/blogs/wmdev/archive/2009/11/11/announcing-new-features-in-windows-marketplace-for-mobile.aspx"&gt;Windows Mobile Developer Blog&lt;/a&gt;, and Eric Nelson&amp;rsquo;s post at the &lt;a href="http://windowsteamblog.com/blogs/windowsphone/archive/2009/11/16/windows-marketplace-for-windows-mobile-6-0-and-6-1.aspx"&gt;Windows Phone Blog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As with every retail marketplace, there is a bit of administrative work involved. Windows Marketplace for Mobile is a new service and a fresh approach that improves frequently with feedback from the developers and ISVs we work with. We are committed to continually improving the entire experience as we learn more about developer and customer needs and behavior. (If you find that Marketplace is not the right distribution channel for your business model, after all, you can of course use any other channel, such as those mentioned above, as they continue to be available. Windows Mobile means freedom of choice.) &lt;/p&gt;
&lt;p&gt;If you are in the US, signing up and getting apps certified should be pretty straightforward by now. In other countries there may be additional steps related to the business and financial processes involved. There also is localization work to be done when you want to submit products to several markets, as the application needs to be localized in the proper language (including the screenshots and descriptions). If there are any questions during this process, your first support resource is the &lt;a href="http://developer.windowsphone.com/Help.aspx"&gt;Windows Marketplace help page&lt;/a&gt;. You can also use the contact form in your &lt;a href="http://developer.windowsphone.com/Marketplace.aspx"&gt;Windows Marketplace portal&lt;/a&gt;, and ask for help or information. Then, we have a &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/mktplace/"&gt;dedicated forum&lt;/a&gt; where team members try to answer your questions as quick as possible. &lt;/p&gt;
&lt;p&gt;Beyond all that, in some countries there are additional dedicated resources that you should know &amp;ndash; let me take Germany here as an example: We have a &lt;a href="http://blogs.msdn.com/windowsphone/"&gt;dedicated Windows phone blog&lt;/a&gt; with news and a contact form for questions, we have our &lt;a href="http://msdn.microsoft.com/de-de/windowsmobile/default.aspx"&gt;local Windows Mobile Developer Center&lt;/a&gt; on MSDN, a &lt;a href="http://twitter.com/windowsphone_de"&gt;Twitter channel&lt;/a&gt;, a &lt;a href="http://bit.ly/wm6dev"&gt;comprehensive introductory document&lt;/a&gt; on Windows Mobile development, a &lt;a href="http://www.microsoft.com/germany/msdn/webcasts/serien/MSDNWCS-0908-01.mspx"&gt;webcast series&lt;/a&gt; &amp;ndash; we even have an &lt;a href="http://bit.ly/mktwin"&gt;exciting local developer contest&lt;/a&gt; which complements the &lt;a href="http://www.mobilethisdeveloper.com/"&gt;global one&lt;/a&gt;! &lt;/p&gt;
&lt;p&gt;You see, there are a lot of great resources that should help you get started with Marketplace. Don&amp;rsquo;t miss this great opportunity to expand your mobile business. Good luck! &lt;/p&gt;
&lt;p&gt;Frank &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=528900" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/marketplace/default.aspx">marketplace</category><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/windowsmobile/default.aspx">windowsmobile</category></item><item><title>Announcing New Features in Windows Marketplace for Mobile</title><link>http://windowsteamblog.com/blogs/wmdev/archive/2009/11/11/announcing-new-features-in-windows-marketplace-for-mobile.aspx</link><pubDate>Wed, 11 Nov 2009 21:47:58 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:528193</guid><dc:creator>Todd Brix</dc:creator><slash:comments>145</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/wmdev/rsscomments.aspx?PostID=528193</wfw:commentRss><comments>http://windowsteamblog.com/blogs/wmdev/archive/2009/11/11/announcing-new-features-in-windows-marketplace-for-mobile.aspx#comments</comments><description>&lt;p&gt;I’m pleased to introduce a few much anticipated upgrades for &lt;a href="http://marketplace.windowsphone.com/"&gt;Windows Marketplace for Mobile&lt;/a&gt; going live today. We introduced Windows Marketplace with the launch of Windows phones on October 6&lt;sup&gt;th &lt;/sup&gt;and promised a second wave of features in November. Today, we’re adding more advanced anti-piracy protection and an improved developer portal for our registered ISVs, as well as introducing PC based shopping and account management for Windows phone customers. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Developer portal improvements and stronger anti-piracy protection&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;We’ve been gathering input on what we can do to improve the developer experience and have made some subtle but important enhancements to the developer portal to enable easier uploading of images, greater insight into account status and several other refinements based on feedback from developers. Today’s update also provides more advanced anti-piracy protection. While the underlying technical changes will be transparent for customers, developers will now be able to take advantage of these new protections by following the steps outlined in this &lt;a href="http://download.microsoft.com/download/F/E/5/FE59BF29-C576-401A-A4C2-D583B5F92509/Windows%20Marketplace%20for%20Mobile%20Anti-Piracy%20White%20Paper.pdf"&gt;anti-piracy whitepaper&lt;/a&gt;. As always, updates to existing applications can be submitted for free. To learn more about developing applications for Windows phones, head over to the &lt;a href="http://developer.windowsphone.com/"&gt;Windows Mobile for Developers&lt;/a&gt; site.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Browse and buy applications from the PC      &lt;br /&gt;&lt;/b&gt;While we’ve heard great feedback on the Marketplace experience on Windows phones, sometimes people just want the benefits of a shopping on a PC. Starting today, Windows phone customers can browse, buy and download applications online at the Windows &lt;a href="http://marketplace.windowsphone.com/"&gt;Marketplace for Mobile site&lt;/a&gt;. The selected applications are delivered wirelessly to the customer’s Windows phone and install the next time the Windows Marketplace client runs on the device. This creates another way for customers to easily find and purchase applications and gives developers a whole new level of exposure.&lt;/p&gt;  &lt;p&gt;Marketplace has been extremely active and I couldn’t be happier with the reactions from both developers and customers. We’ve been open for just over one month and already we can see that there’s demand for an application marketplace that doesn’t compromise on quality or experience. I look forward to providing a more detailed update on Windows Marketplace for Mobile when we extend the service to Windows Mobile 6.0 and 6.1 customers later this month. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=528193" width="1" height="1"&gt;</description></item><item><title>The Windows Marketplace for Mobile Client and your Setup code</title><link>http://windowsteamblog.com/blogs/wmdev/archive/2009/10/29/the-windows-marketplace-for-mobile-client-and-your-setup-code.aspx</link><pubDate>Thu, 29 Oct 2009 19:17:45 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:527439</guid><dc:creator>Mike Francis</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/wmdev/rsscomments.aspx?PostID=527439</wfw:commentRss><comments>http://windowsteamblog.com/blogs/wmdev/archive/2009/10/29/the-windows-marketplace-for-mobile-client-and-your-setup-code.aspx#comments</comments><description>&lt;p&gt;The Windows Marketplace for Mobile client provides users a streamlined experience to purchase and install applications on their Windows Mobile 6.5 devices (&lt;a href="http://windowsteamblog.com/blogs/windowsphone/archive/2009/09/30/windows-marketplace-update-countdown-to-launch.aspx"&gt;coming soon&lt;/a&gt; for 6.1, and 6.0). &lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px auto; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Markplace Client: Install in progress" border="0" alt="Markplace Client: Install in progress" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/installerprogress_5F00_thumb_5F00_700C2138.png" width="180" height="240" /&gt;&lt;/p&gt;  &lt;p&gt;As you will notice when installing applications, the user interface is different from the typical CAB file installation (see below) perhaps you are used to.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/NoMPClient_5F00_1A785256.png"&gt;&lt;img style="border-right-width: 0px; margin: 0px auto; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="No Marketplace Client" border="0" alt="No Marketplace Client" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/NoMPClient_5F00_thumb_5F00_3A272C1E.png" width="180" height="240" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It is very important that the Marketplace install experience be uniform and streamlined. To keep it this way, no custom UI (errors, prompts, informational messages, etc.) should be displayed during installation or uninstallation. &lt;/p&gt;  &lt;p&gt;If you absolutely must display custom UI, there are some things you should know about the Marketplace client.&lt;/p&gt;  &lt;p&gt;The Marketplace client achieves a streamlined experience by suppressing the normal user interface, displaying a client specific progress bar and providing feedback when the installation has completed. This can cause problems for applications that have custom prompts implemented in the &lt;a href="http://msdn.microsoft.com/en-us/library/aa924308.aspx"&gt;setup dll&lt;/a&gt;. For example, you may want to prompt the user to start your application after installation has completed. This is easily done by adding the appropriate &lt;a href="http://msdn.microsoft.com/en-us/library/aa926303.aspx"&gt;MessageBox&lt;/a&gt; prompt to the &lt;a href="http://msdn.microsoft.com/en-us/library/bb415364.aspx"&gt;Install_Init&lt;/a&gt; export of your setup dll. However, there can be problems with this. &lt;/p&gt;  &lt;p&gt;The foreground display of your MessageBox or other custom UI, depends on knowing the window handle of the calling process. When your application is installed with the Marketplace client, no window handle is passed to your setup DLL’s exported functions. This can cause your custom UI to not be displayed in the foreground. This causes confusion for the user since it looks like the installation is still running, but there is no UI feedback. The only recourse for the user is to use task manager to locate the prompt window and select it to bring it to the foreground. This is a very poor user experience.&amp;#160; &lt;/p&gt;  &lt;p&gt;You can resolve this by using the MB_TOPMOST | MB_SETFOREGROUND flags when calling &lt;a href="http://msdn.microsoft.com/en-us/library/aa926303.aspx"&gt;MessageBox&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/library/aa930455.aspx"&gt;WS_EX_TOPMOST&lt;/a&gt; when creating a window for custom UI.&lt;/p&gt;  &lt;p&gt;Have you tried the Marketplace client yet? No? Don’t have a &lt;a href="http://www.microsoft.com/windowsmobile/en-us/meet/wm65-upgrade.mspx"&gt;6.5 ROM update&lt;/a&gt; or device yet? No problem. Download the Windows Mobile 6.5 standalone emulator images &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=20686A1D-97A8-4F80-BC6A-AE010E085A6E&amp;amp;displaylang=en"&gt;here&lt;/a&gt;. These come with a fully functional Marketplace client you can download and install apps with.&lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=527439" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/marketplace/default.aspx">marketplace</category><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/windowsmobile/default.aspx">windowsmobile</category><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/install/default.aspx">install</category></item><item><title>Widget Anatomy – Touch and D-Pad inputs, oh joy!</title><link>http://windowsteamblog.com/blogs/wmdev/archive/2009/10/27/next-post-widget-anatomy-touch-and-d-pad-inputs-oh-joy.aspx</link><pubDate>Wed, 28 Oct 2009 01:00:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:526630</guid><dc:creator>Jorge Peraza</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/wmdev/rsscomments.aspx?PostID=526630</wfw:commentRss><comments>http://windowsteamblog.com/blogs/wmdev/archive/2009/10/27/next-post-widget-anatomy-touch-and-d-pad-inputs-oh-joy.aspx#comments</comments><description>&lt;p&gt;This is fifth and final part of my Widget Anatomy series that described the ins and outs of the Widget Framework that shipped with windows mobile 6.5.&amp;#160; In this installment we will discuss the different ways a Widget can receive inputs from the user and how best respond to them.&lt;/p&gt;  &lt;h2&gt;First the easy one: Touch&lt;/h2&gt;  &lt;p&gt;Touch is the primary input for all our professional devices and it looks like they will be a significant percentage of our device offering.&amp;#160; Handling this is fairly easy since the browser engine translate the touch event into a mouse click which can be handled by using the &lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms536913(VS.85).aspx"&gt;onclick&lt;/a&gt; &lt;/strong&gt;event handler as shown in the following example:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;js/ImageSearch.js&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;SearchBox&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;input&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;SearchQuery&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;p&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;images/search.png&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;searchIcon&amp;quot;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;               &lt;span style="color: #ff0000"&gt;onclick&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;doSearch();&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;It is important to note that, since there is no “mouse” for widgets most of the other mouse related events like onmouseover, onmousemove, etc will not be triggered in a reliable enough way to use them.&lt;/p&gt;

&lt;h2&gt;Now the hard one: The Directional-Pad&lt;/h2&gt;

&lt;p&gt;I been making special emphasis to the fact that Widgets work seamless across all Windows Phones so, we need to ensure that the can be used correctly when the user interacts with it using the directional path.&lt;/p&gt;

&lt;p&gt;It is important to note that, unlike IE6, a The widget framework will respond to a D-Pad input event by moving the focus to the closed &lt;strong&gt;actionable&lt;/strong&gt; element in the direction of the user click.&amp;#160; This behavior is similar to the old pocketIE and among friends we call it “Link to Link navigation”.&lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;actionable &lt;/strong&gt;element is defined as any DOM element that can receive focus (Like a form field) or an element that implements its &lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms536913(VS.85).aspx"&gt;onclick&lt;/a&gt; &lt;/strong&gt;event handler.&amp;#160; When an &lt;strong&gt;actionable&lt;/strong&gt; element gain focus the &lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms536934(VS.85).aspx"&gt;onfocus&lt;/a&gt; &lt;/strong&gt;even is triggered, the same way, the focus is moved away from the element the &lt;a href="http://msdn.microsoft.com/en-us/library/ms536909(VS.85).aspx"&gt;&lt;strong&gt;onblur&lt;/strong&gt;&lt;/a&gt; event is triggered.&amp;#160; Now we can easily use those events to show the user where the focus is since the Widget Framework does not automatically highlights the focused element.&amp;#160; We do this because we don’t want to inhibit the creativity of the widget creator to design his/her own focused highlight strategy.&lt;/p&gt;

&lt;p&gt;The only “little” extra detail is that all elements that can gain focus need to have the &lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms534654(VS.85).aspx"&gt;tabindex&lt;/a&gt;&lt;/strong&gt; property defined (the value is not important).&amp;#160; This is easily forgotten but if not set, the focus and blur events &lt;strong&gt;will not trigger&lt;/strong&gt;, &lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt;&amp;#160; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; OnFocus(element) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;         element.style.backgroundColor = &lt;span style="color: #006080"&gt;&amp;quot;red&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; OnBlur(element) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         element.style.backgroundColor = &lt;span style="color: #006080"&gt;&amp;quot;white&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;onfocus&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;OnFocus(document.getElementById('one'))&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #ff0000"&gt;onblur&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;OnBlur(document.getElementById('one'))&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #ff0000"&gt;onclick&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;alert(1)&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #ff0000"&gt;tabindex&lt;/span&gt;=&lt;span style="color: #ff0000"&gt;1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;one&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;style&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;font-size:medium:&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;1&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;onfocus&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;OnFocus(document.getElementById('two'))&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #ff0000"&gt;onblur&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;OnBlur(document.getElementById('two'))&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #ff0000"&gt;onclick&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;alert(2)&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;span style="color: #ff0000"&gt;tabindex&lt;/span&gt;=&lt;span style="color: #ff0000"&gt;2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;two&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;style&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;font-size:medium;&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;2&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In this example, we created two divs that can receive the input focus, you can move from one to the other using the D-Pad, the element that receives focus changes the color of its background to red.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/Screen05_5F00_17B7D7E1.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Screen05" border="0" alt="Screen05" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/Screen05_5F00_thumb_5F00_056F111F.png" width="184" height="244" /&gt;&lt;/a&gt;&amp;#160; &lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/Screen06_5F00_4BEC0127.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Screen06" border="0" alt="Screen06" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/Screen06_5F00_thumb_5F00_24B1B7F2.png" width="184" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Writing Windows Mobile applications is now as easy as writing a web page, and, by following some best practices your widget can be as functional and attractive as any other native application on the platform.&lt;/p&gt;

&lt;p&gt;This is the end of this blog series and since Windows Phones are now available on many countries, you should go get one and write many cool widgets for it.&amp;#160; Don’t forget to share the results with the world by uploading them to the &lt;a href="http://developer.windowsmobile.com/"&gt;marketplace&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Until next time&lt;/p&gt;

&lt;p&gt;Jorge Peraza&lt;/p&gt;

&lt;h2&gt;Widget anatomy series at glance&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/blogs/windowsphone/archive/2009/07/26/widget-anatomy-the-manifest.aspx"&gt;#1 The manifest&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/blogs/windowsphone/archive/2009/09/02/widget-anatomy-the-keys-for-a-great-user-experience.aspx"&gt;#2 The keys for a great user experience&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/blogs/windowsphone/archive/2009/09/02/widget-anatomy-the-keys-for-a-great-user-experience.aspx"&gt;#3 Performance and battery life&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/blogs/wmdev/archive/2009/10/15/widget-anatomy-security-insights.aspx"&gt;#4 Security insights&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://windowsteamblog.com/blogs/wmdev/archive/2009/10/27/next-post-widget-anatomy-touch-and-d-pad-inputs-oh-joy.aspx"&gt;#5 Touch and D-Pad inputs, oh joy!&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=526630" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/6.5/default.aspx">6.5</category><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/Widgets/default.aspx">Widgets</category></item><item><title>Widget Anatomy – Security Insights</title><link>http://windowsteamblog.com/blogs/wmdev/archive/2009/10/15/widget-anatomy-security-insights.aspx</link><pubDate>Thu, 15 Oct 2009 22:45:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:526567</guid><dc:creator>Jorge Peraza</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/wmdev/rsscomments.aspx?PostID=526567</wfw:commentRss><comments>http://windowsteamblog.com/blogs/wmdev/archive/2009/10/15/widget-anatomy-security-insights.aspx#comments</comments><description>&lt;p&gt;Previous post: &lt;a href="http://windowsteamblog.com/blogs/windowsphone/archive/2009/09/22/widget-anatomy-performance-and-battery-life-the-final-frontier.aspx"&gt;Widget Anatomy – Performance and battery life&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This is part four of my &lt;strong&gt;Widget Anatomy&lt;/strong&gt; series which which will explain the ins and outs of the Widget Framework that is shipping as part of Windows Mobile 6.5.&amp;#160; In this installment I will discuss the Widget Framework’s security model..&lt;/p&gt;  &lt;h2&gt;Inside the sandbox – The Widget Framework security model&lt;/h2&gt;  &lt;p&gt;It is true, Widgets are executed inside a sandbox, and because of this, there are bounded to a rather strict security policy but can be summarized as follows:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Widgets can’t read files from the device nor can access the registry directly.&amp;#160; A notable exception are all files that are part of the Widget package itself. &lt;/li&gt;    &lt;li&gt;Cookies can be used as temporary storage but developers are encouraged to use the persistent storage API instead.&amp;#160;&amp;#160; Cookies, browser history and local cache are&amp;#160; isolated per widget and completely separated from the browser. &lt;/li&gt;    &lt;li&gt;Widgets can’t navigate their main frame to any URL with the exception of fragment inside itself.&amp;#160; You can use an iframe to open a web URL though. &lt;/li&gt;    &lt;li&gt;Widgets can navigate to the following specific purpose URIs &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;   &lt;table border="2" cellspacing="4" cellpadding="2" width="603"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="191"&gt;           &lt;p align="center"&gt;&lt;strong&gt;URI&lt;/strong&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="193"&gt;           &lt;p align="center"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="199"&gt;           &lt;p align="center"&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="191"&gt;           &lt;p align="center"&gt;SMS:&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="193"&gt;Starts composing an SMS message addressed to the given phone number&lt;/td&gt;          &lt;td valign="top" width="199"&gt;sms:1111111111&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="191"&gt;           &lt;p align="center"&gt;mailto:&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="193"&gt;Starts composing a mail message using the specified parameters (Like destination, subject and body)&lt;/td&gt;          &lt;td valign="top" width="199"&gt;&lt;a href="mailto:test@test.com?subject=Hello?body=From%20Here"&gt;&lt;font color="#4295d1"&gt;mailto:test@test.com?subject=Hello?body=From%20Here&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="191"&gt;           &lt;p align="center"&gt;callto:&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="193"&gt;Initiates a voice call to the given number&lt;/td&gt;          &lt;td valign="top" width="199"&gt;callto:1111111111&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="191"&gt;           &lt;p align="center"&gt;tel:&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="193"&gt;Initiates a voice call to the given number&lt;/td&gt;          &lt;td valign="top" width="199"&gt;tel:1111111111&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="191"&gt;           &lt;p align="center"&gt;http:, https:&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="193"&gt;Opens the specified URI using the default browser.&lt;/td&gt;          &lt;td valign="top" width="199"&gt;&lt;a href="http://www.microsoft.com/"&gt;&lt;font color="#4295d1"&gt;http://www.microsoft.com&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;&lt;font color="#4295d1"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;h2&gt;Widgets and the Marketplace&lt;/h2&gt;  &lt;p&gt;Windows Mobile 6.5 restricts distribution of Widgets to trusted sources only.&amp;#160; This means consumers will only be able to install widgets from the Marketplace and, on some cases, Mobile Operator stores directly.&amp;#160; This restriction was implemented because we don’t currently support digital signature verification for widget files which prevents users from being able to verify the origins and authenticity of any given widget.&amp;#160; This might seem a little restrictive but I believe it provides the right balance between security and flexibility, specially if you consider that there are ways to allow enthusiasts and developers to install widgets from non-trusted sources, as long as they acknowledge and understand the risks of doing so.&amp;#160; Use your best judgment :).&lt;/p&gt;  &lt;h2&gt;Other important security considerations&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;The local persistent storage is unencrypted, use caution when storing information that should be protected in clear text. &lt;/li&gt;    &lt;li&gt;The widget ID is sent to the server as part of the user agent string if you would like to use it on your server for any reason. &lt;/li&gt;    &lt;li&gt;Widget files are stored unencrypted on the device file system so anyone with device access can potentially read them. &lt;/li&gt;    &lt;li&gt;Cross domain data access is allowed, this is super important for widgets since they can be used to mash up data from multiple sources. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;That’s it for now, feel free to comment about any other security related questions that were not covered.&lt;/p&gt;  &lt;p&gt;Next post: Widget Anatomy – Touch and D-Pad inputs, oh joy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=526567" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/6.5/default.aspx">6.5</category><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/Widgets/default.aspx">Widgets</category></item><item><title>Marketplace Client, Your Applications, and Registry Keys</title><link>http://windowsteamblog.com/blogs/wmdev/archive/2009/10/13/marketplace-client-your-applications-and-registry-keys.aspx</link><pubDate>Tue, 13 Oct 2009 00:25:42 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:526468</guid><dc:creator>Mike Francis</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://windowsteamblog.com/blogs/wmdev/rsscomments.aspx?PostID=526468</wfw:commentRss><comments>http://windowsteamblog.com/blogs/wmdev/archive/2009/10/13/marketplace-client-your-applications-and-registry-keys.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/marketplaceSmall_5F00_2300CF78.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 0px 15px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="marketplaceSmall" border="0" alt="marketplaceSmall" align="left" src="http://windowsteamblog.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/wmdev/marketplaceSmall_5F00_thumb_5F00_74A749CA.jpg" width="79" height="93" /&gt;&lt;/a&gt; The Windows Marketplace for Mobile is off to a great start since its release October 6th. One issue that has tripped up a few developers submitting their applications has been the use of internal registry keys used to determine the location of the application. Some clever developers have discovered that there is a list of installed applications stored in the registry under: HKEY_LOCAL_MACHINE\Software\Apps. Under the application name, you will find the directory in which the application has been installed. For example:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d9a85ae6-e1bb-43a4-a773-ea1f48c88905" class="wlWriterSmartContent"&gt;   &lt;pre class="brush: text"&gt;HKEY_LOCAL_MACHINE\Software\Apps\Company Application Name
InstallDir=”\Program Files\Application Name”&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;a similar list can be found here:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0d14cc11-ab2e-483a-bbb7-5688c735f2e3" class="wlWriterSmartContent"&gt;
  &lt;pre class="brush: text"&gt;[HKEY_LOCAL_MACHINE\Security\AppInstall\Company Application Name]
InstallDir=”\Program Files\Application Name”&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Since Windows Mobile does not support the concept of a current working directory, this has been one way to determine where the EXE is running from. A better approach, that is not dependant on these registry keys,&amp;#160; uses the following code (See Chistec’s blog &lt;a href="http://www.christec.co.nz/blog/archives/date/2008/12" target="_blank"&gt;post&lt;/a&gt;):&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:44221636-4382-42c2-9fdb-96544b2c52d4" class="wlWriterSmartContent"&gt;
  &lt;pre class="brush: cpp"&gt;GetModuleFileName(GetModuleHandle(NULL), pszFullPath, MAX_PATH); &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;For managed code (See Chistec’s blog &lt;a href="http://www.christec.co.nz/blog/archives/201" target="_blank"&gt;post&lt;/a&gt;):&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Reflection;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private string &lt;/span&gt;GetApplicationExe()
{
  &lt;span style="color: green"&gt;// Determine the full path to the application executable
  &lt;/span&gt;&lt;span style="color: blue"&gt;return &lt;/span&gt;Assembly.GetExecutingAssembly().GetName().CodeBase;
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;You can then parse out the application path from the returned file name.&lt;/p&gt;

&lt;p&gt;So what is wrong with using these undocumented registry keys? When your application is installed by the Marketplace client, it creates these registry keys, but not with the names you would expect. Therefore, if your application is relying on any of these keys, if will fail to find them, because they will not exist.&amp;#160; This has tripped up a few developers because this issue does not surface unless you install the application after it has gone through the Marketplace ingestion process. (The processing of your application after it has passed certification testing.) &lt;/p&gt;

&lt;p&gt;To summarize, if you need to get the directory in which it was your application was installed, use either the native or managed APIs above. Also, make sure you are not using either of these undocumented registry keys.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://windowsteamblog.com/aggbug.aspx?PostID=526468" width="1" height="1"&gt;</description><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/registry/default.aspx">registry</category><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/marketplace/default.aspx">marketplace</category><category domain="http://windowsteamblog.com/blogs/wmdev/archive/tags/windowsmobile/default.aspx">windowsmobile</category></item></channel></rss>