<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Pat Altimore's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/patricka/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/patricka/feed.xml</link>
    <description>Tips and Tricks for Developers</description>
    <lastBuildDate>Mon, 04 Mar 2019 19:22:16 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Why Do I See Different Blue Enterprise Mode IE Indicators Next to the Address Bar?</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/why-do-i-see-different-blue-enterprise-mode-ie-indicators-next-to-the-address-bar</link>
      <pubDate>Wed, 24 Feb 2016 11:20:00 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2016/02/24/why-do-i-see-different-blue-enterprise-mode-ie-indicators-next-to-the-address-bar/</guid>
      <description><![CDATA[If Enterprise Mode IE (EmIE) is enabled, you should see a blue box with buildings next to the...]]></description>
      <content:encoded><![CDATA[If <a href="https://technet.microsoft.com/en-us/library/dn640687.aspx">Enterprise Mode IE</a> (EmIE) is enabled, you should see a blue box with buildings next to the address bar. On some hardware, you may see a blue box with white EmIE text.

The behavior depends on your display settings.  The “EmIE” text is a fallback if there isn’t an acceptable icon resource for your display settings. For example, if my DPI setting is 150% or lower,

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5824.150_689D4B7E.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="150" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7343.150_thumb_3CEC8182.png" alt="150" width="244" height="42" border="0" /></a>

I will get the building icon.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2133.EmIE-Buildings_4ABEC77D.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="EmIE Buildings" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/0336.EmIE-Buildings_thumb_718CDDBD.png" alt="EmIE Buildings" width="61" height="46" border="0" /></a>

If I set my DPI setting to 175%,

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1004.175_6A6DA145.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="175" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4456.175_thumb_3809CDC6.png" alt="175" width="244" height="39" border="0" /></a>

I get the “EmIE” text.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6740.EmIE-text_5ACD9634.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="EmIE text" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2630.EmIE-text_thumb_5ED7E406.png" alt="EmIE text" width="68" height="48" border="0" /></a>

The icon that is displayed has no affect on the functionality of Enterprise Mode.  This is just how Internet Explorer handles DPI differences to prevent the icon from looking stretched.]]></content:encoded>
    </item>
    <item>
      <title>If I Remove or Don’t Use Internet Explorer 8, 9, or 10, Can I Avoid Upgrading to Internet Explorer 11?</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/if-i-remove-or-dont-use-internet-explorer-8-9-or-10-can-i-avoid-upgrading-to-internet-explorer-11</link>
      <pubDate>Fri, 08 Jan 2016 15:25:44 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2016/01/08/if-i-remove-or-dont-use-internet-explorer-8-9-or-10-can-i-avoid-upgrading-to-internet-explorer-11/</guid>
      <description><![CDATA[On January 12, 2016, only the most current version of Internet Explorer available for Windows will...]]></description>
      <content:encoded><![CDATA[On January 12, 2016, <a href="https://support.microsoft.com/en-us/lifecycle#gp/Microsoft-Internet-Explorer">only the most current version of Internet Explorer available for Windows</a> will be supported.  For older OS such as Windows 7 and Windows Server 2008 R2, you will need to upgrade to IE11. Even if you don’t use IE on a PC such as a server, you should upgrade to the latest version of the IE browser.
<h1>Why Upgrade?</h1>
There are many components that constitute the browser.  Most of the components are part of the operating system including the JavaScript / HTML rendering engine (MSHTML.dll), the Web Browser control (ieframe.dll), and the Windows Internet Protocol Handler (WinInet.dll). The <a href="https://msdn.microsoft.com/en-us/library/aa741312(v=vs.85).aspx">browser application (IExplore.exe) uses these OS components</a> for script execution, rendering, HTTP requests, etc.  When you upgrade the browser, you potentially upgrade all of these components.

For example, if we use <a href="https://technet.microsoft.com/en-us/sysinternals/processexplorer.aspx">Process Explorer</a> to view the IExplore.exe process, the loaded DLLs will include IEFrame.dll, MSHTML.dll, URLMon.dll, and WinInet.dll.  The Web Browser control (IEFrame.dll) is the entry point and it loads the other DLLs.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1104.image_5925878A.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6318.image_thumb_58B95495.png" alt="image" width="644" height="210" border="0" /></a>

Now, let’s view an application that uses the Web Browser control. EmbeddedIE.exe is a simple test application I created that uses the Web Browser control.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5710.image_46708DD3.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/0458.image_thumb_621519C9.png" alt="image" width="644" height="210" border="0" /></a>

Notice that IEFrame.dll is in the list of loaded DLLs.  If we looked through the list of loaded DLLs, we would find MSHTML.dll, URLMon.dll, and WinInet.dll.

One last example… I’m using Windows Live Writer to create this blog post. It uses the Web Browser control too.  Notice that IEFrame.dll is in the list of loaded DLLs. Just like the previous example, all of the other DLLs are also loaded.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4705.image_567F5C8A.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6811.image_thumb_2F451355.png" alt="image" width="644" height="210" border="0" /></a>

After January 12, 2016, only the most current version of IE will receive security updates. Therefore, if you aren’t upgraded to the current version of IE, you won’t be able to apply the current security updates. This could result in some Windows components not being serviced. To ensure applications using components (e.g. Web Browser control) are fully patched, update to the latest version of IE and apply future cumulative IE updates.
<h1>If I Remove Internet Explorer, Will My IE System Components Update?</h1>
In order for IE related Windows components to update, you will need to be on the latest version of IE.  If you’re planning on removing IE, you should upgrade to the latest version first and then remove IE.

When you remove IE from “Windows Features” by unchecking the selection box, IE isn’t actually removed from the PC.  All of the system components remain for use by the operating system and other applications. The web browser application (IExplore.exe) is “hidden” and not removed. When you apply security updates to the PC, the Windows components as well as the hidden IExplore.exe are serviced. Therefore, if you re-enable IE, it should be up to date.

For tips and tricks on migrating to IE11 in an enterprise environment, see my <a href="http://blogs.msdn.com/b/patricka/archive/2015/12/02/internet-explorer-11-migration-quick-start.aspx">Internet Explorer 11 Migration Quick Start</a> post.]]></content:encoded>
    </item>
    <item>
      <title>Internet Explorer 11 Migration Quick Start</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/internet-explorer-11-migration-quick-start</link>
      <pubDate>Wed, 02 Dec 2015 15:14:00 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2015/12/02/internet-explorer-11-migration-quick-start/</guid>
      <description><![CDATA[On Jan 12, 2016, IE11 will be the only supported version of IE on the most Windows versions. In this...]]></description>
      <content:encoded><![CDATA[On Jan 12, 2016, <a href="https://support.microsoft.com/en-us/gp/microsoft-internet-explorer">IE11 will be the only supported version of IE on the most Windows versions</a>. In this post, I will cover the essentials to jumpstart your migration. There are three main areas to plan for when you migrate: deployment, configuration, and compatibility.
<h1>Deployment</h1>
There are several ways to deploy IE.  Choose the method that works best for your environment. Here are a few tips to consider when choosing a method
<ul>
	<li>When choosing a method, keep in mind prerequisites, number of reboots, language packs, and cumulative updates.</li>
	<li>If you are planning to leverage Enterprise Mode or Site Discovery functionality, you will need cumulative updates applied (June ‘15 or greater). Otherwise, this functionality will not work until the updates are applied.</li>
</ul>
The main deployment options are Microsoft System Center Configuration Manager (SCCM) or similar management tool, Windows Server Update Services (WSUS), Deployment Image Servicing and Management (DISM), and Internet Explorer Administration Kit (IEAK).

There is a great blog post that <a href="http://blogs.technet.com/b/windowsfr/archive/2015/08/23/windows-7-comment-d-233-ployer-internet-explorer-11-en-15-minutes.aspx">compares the deployment options here (French</a>). Alternatively, use Microsoft Translator to <a href="http://www.microsofttranslator.com/bv.aspx?from=&amp;to=en&amp;a=http%3A%2F%2Fblogs.technet.com%2Fb%2Fwindowsfr%2Farchive%2F2015%2F08%2F23%2Fwindows-7-comment-d-233-ployer-internet-explorer-11-en-15-minutes.aspx">translate the post to your preferred language</a>.

More resources:
<ul>
	<li><a href="https://technet.microsoft.com/library/dn338135.aspx">Internet Explorer 11 Deployment Guide</a></li>
	<li><a href="https://technet.microsoft.com/en-us/library/dn338131.aspx">Choose how to install Internet Explorer 11</a></li>
	<li><a href="https://support.microsoft.com/en-us/kb/3061428">How to create an all-inclusive deployment package for Internet Explorer 11</a></li>
</ul>
<h1> Configuration</h1>
The recommended way to configure and manage settings in IE11 is to use group policy and group policy preferences (GPP).
<ul>
	<li>Leverage the ADM template for Internet Explorer (inetres.admx).  This contains the recommended default policies that apply to IE.</li>
	<li>Group policy preferences for IE are available as an <a href="http://technet.microsoft.com/en-us/library/cc754649.aspx">Internet Settings Extension</a> in the User Configuration section.</li>
	<li>If you used Internet Explorer Maintenance (IEM) in the past, GPP is its replacement. Use <a href="http://technet.microsoft.com/en-us/library/jj890998.aspx">this reference</a> to map IEM settings to GPP.</li>
	<li>When you test sites for compatibility, configuration can influence compatibility. Test in an environment that matches your planned production configuration.</li>
</ul>
A full list of GPO settings to configure IE is available in a downloadable <a href="http://www.microsoft.com/en-us/download/details.aspx?id=25250">Excel sheet</a>. Filter the sheet on inetres.admx to view all the IE settings from version 6 through 11. A great GPO search engine that contains all ADM template settings including IE is available <a href="http://gpsearch.azurewebsites.net/">here</a>.
<h1>Compatibility</h1>
In a perfect world, you would update all sites to modern standards as part of your Internet Explorer 11 migration. This would include all your existing line of business sites, 3<sup>rd</sup> party vendor sites, and external sites. This usually isn’t possible in a short amount of time. Therefore, you can leverage the compatibility features included in IE11 to mitigate your older web sites.

To quickly learn IE’s compatibility features, I highly recommend the following resources:
<ol>
	<li>View the <a href="https://channel9.msdn.com/events/Ignite/2015/BRK2307">Enterprise Mode Deep Dive</a> from Ignite.</li>
	<li>Download the <a href="https://technet.microsoft.com/en-us/ie/mt612809.aspx">Web Application Compatibility Lab Kit</a>. This contains an excellent overview presentation and documentation to understand, configure, and use Internet Explorer’s compatibility features.</li>
</ol>
<h4>Inventory</h4>
Having a good understanding of your inventory of web sites in your enterprise is valuable preparation for a migration. Enterprise Site Discovery can help you collect information about what sites users are visiting.

For more information, review the blog post about <a href="http://blogs.msdn.com/b/ie/archive/2015/04/23/announcing-improvements-to-enterprise-mode-and-enterprise-site-discovery.aspx">Enterprise Site Discovery</a> and the TechNet article on collecting data with <a href="https://technet.microsoft.com/en-us/library/dn833204.aspx">Collecting data with Enterprise Site Discovery</a>.
<h4>What Compatibility Mitigation should I Use?</h4>
IE can “emulate” prior version of the browser using Document Modes, Compatibility View, and Enterprise Modes.

The following is a quick definition of each compatibility feature and how it can be controlled.
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="545"><strong>Compatibility feature</strong></td>
<td valign="top" width="545"><strong>Controlled using</strong></td>
</tr>
<tr>
<td valign="top" width="545"><a href="https://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx"><strong>Document Modes</strong></a> interpret webpages and will display them similar to older version of IE. The available modes are 5, 7, 8, 9, 10, and 11. Document mode 5 (Quirks mode) represents IE versions 1 through 6.</td>
<td valign="top" width="545"><a href="https://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx">X-UA-Compatible meta tag</a>

<a href="https://technet.microsoft.com/en-us/library/dn640699.aspx">Enterprise Mode site list</a>

<a href="https://technet.microsoft.com/en-us/library/dn872481.aspx">F12 Developer tools</a></td>
</tr>
<tr>
<td valign="top" width="545"><a href="https://msdn.microsoft.com/en-us/library/gg699485(v=vs.85).aspx"><strong>Compatibility view</strong></a> was introduced in IE8 to support sites designed for IE7 and earlier. It emulates document mode 7.</td>
<td valign="top" width="545">User defined list in IE’s Compatibility View settings

Microsoft defined list for the Internet zone

IT defined domain list using group policy

IT defined for the entire Intranet zone using group policy</td>
</tr>
<tr>
<td valign="top" width="545"><a href="https://technet.microsoft.com/en-us/library/mt269903.aspx"><strong>Enterprise Mode</strong></a> is a “high fidelity” emulation of IE8, IE7, or IE5.</td>
<td valign="top" width="545"><a href="https://technet.microsoft.com/en-us/library/dn640699.aspx">Enterprise Mode site list</a>

<a href="https://technet.microsoft.com/en-us/library/dn872481.aspx">F12 Developer tools</a></td>
</tr>
</tbody>
</table>
Since there are several ways to control the compatibility features, IE prioritizes the different methods to allow you to “layer” the compatibility options. When planning your compatibility strategy, it’s important to understand the following is the priority list (highest to lowest):
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="102"><strong>Priority</strong></td>
<td valign="top" width="370"><strong>Compatibility setting</strong></td>
<td valign="top" width="315"><strong>Owner</strong></td>
</tr>
<tr>
<td valign="top" width="102">
<p align="center">1</p>
</td>
<td valign="top" width="370"><a href="https://technet.microsoft.com/en-us/library/dn872481.aspx">F12 Developer Tools</a></td>
<td valign="top" width="315">Development, Test</td>
</tr>
<tr>
<td valign="top" width="102">
<p align="center">2</p>
</td>
<td valign="top" width="370"><a href="https://technet.microsoft.com/en-us/library/dn640699.aspx">Enterprise Mode site list</a></td>
<td valign="top" width="315">IT</td>
</tr>
<tr>
<td valign="top" width="102">
<p align="center">3</p>
</td>
<td valign="top" width="370"><a href="https://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx">X-UA-Compatible meta tag</a></td>
<td valign="top" width="315">Development</td>
</tr>
<tr>
<td valign="top" width="102">
<p align="center">4</p>
</td>
<td valign="top" width="370"><a href="https://msdn.microsoft.com/en-us/library/gg699485(v=vs.85).aspx">Compatibility View</a></td>
<td valign="top" width="315">IT</td>
</tr>
<tr>
<td valign="top" width="102">
<p align="center">5</p>
</td>
<td valign="top" width="370"><a href="https://msdn.microsoft.com/en-us/library/jj676916(v=vs.85).aspx">&lt;!DOCTYPE&gt; directive</a></td>
<td valign="top" width="315">Development</td>
</tr>
</tbody>
</table>
See <a href="https://msdn.microsoft.com/en-us/library/ff405803(v=vs.85).aspx">How Internet Explorer Chooses Between Document Modes</a> for more information.

For guidance on how to determine a document mode using F12 developer tools and adding it to your Enterprise Mode site list, see: <a href="https://technet.microsoft.com/en-us/library/dn872481.aspx">Fix web compatibility issues using document modes and the Enterprise Mode site list</a>
<h4>Modernizing Web Sites</h4>
It’s recommended to run in the highest document mode available. A good analogy would be purchasing a car. You will get the best performance, reliability, and security with a newer model car. Similarly, higher document modes give you the best performance, reliability and security. If you have web site that you want to update to modern standards, here are some resources to get you started.
<ul>
	<li><a href="https://msdn.microsoft.com/en-us/library/dn467846(v=vs.85).aspx">IE compatibility changes by version</a></li>
	<li><a href="https://dev.windows.com/en-us/microsoft-edge/tools/">Modernization tools</a></li>
</ul>
<h1> Summary</h1>
<ul>
	<li>Pick a deployment technique that will deploy IE with the latest cumulative updates.</li>
	<li>Leverage the ADM templates and decide on your configuration settings early. Test using your planned production settings.</li>
	<li>Leverage Enterprise Mode site list to mitigate older sites.</li>
	<li>Keep in mind that compatibility features can be layered. Add only broken sites to the Enterprise mode site list.</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>Controlling WebBrowser Control Compatibility</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/controlling-webbrowser-control-compatibility</link>
      <pubDate>Mon, 12 Jan 2015 21:25:17 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2015/01/12/controlling-webbrowser-control-compatibility/</guid>
      <description><![CDATA[If you have a embedded browser in your Windows application, you may be encountering a rendering or...]]></description>
      <content:encoded><![CDATA[If you have a embedded browser in your Windows application, you may be encountering a rendering or some other kind of compatibility issue with the content you are trying to display. In this post, I’ll talk about some options to try to fix those issues. The <a href="http://msdn.microsoft.com/en-us/library/ie/aa752040(v=vs.85).aspx">web browser control</a> is known by many names: WebBrowser control, WebOC, shdocvw, ieframe, etc.  I prefer calling it the Web Browser control but what ever you like to call it, the compatibility issues and solutions are the same.
<h2>What are the Defaults?</h2>
I was at a restaurant once with some friends. When the waitress asked my friend what he would like on his hamburger, he said “What are the defaults?” The developers at the table knew what he meant but the waitress was very confused. <img class="wlEmoticon wlEmoticon-smile" style="border-style: none" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2742.wlEmoticon-smile_12A2D15B.png" alt="Smile" />

Like burgers, the WebBrowser control has a default configuration. By default, the WebBrowser control runs in compatibility view mode. Compatibility view mode is basically document mode 7.

Below is a screenshot of a simple .NET application using the web browser control.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7115.image_603EFDDB.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1680.image_thumb_74C44D59.png" alt="image" width="404" height="195" border="0" /></a>

The web page reports back the document mode and the user agent string received by the server. By default, the WebBrowser control sends a “IE 7” user agent string and renders the content using document mode “7”.
<h2>How do I Change the Default WebBrowser Document Mode?</h2>
If compatibility view does not render your content correctly, you have a couple of options. Depending on your scenario, you may need one or both of these options.
<h3>Compatibility Meta Tag</h3>
If you have control over the web sites or web pages that are being accessed by the web browser control, you can add <a href="http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx">compatibility meta tags</a> to control the document mode. Below is a screenshot of the same WebBrowser control application displaying a page which includes <em>&lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;.</em>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1273.image_1B92639A.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1106.image_thumb_74581A64.png" alt="image" width="404" height="209" border="0" /></a>

The “<em>IE=edge</em>” causes the browser control to render the content in the highest available document mode. In this case, IE 11 is installed resulting in the content being displayed in document mode 11.

<strong>Note:</strong> The user agent string sent to the server in the request is IE 7. Be aware of this mismatch if you will also be browsing to the same content in the IE browser. The full IE browser would send an IE 11 user agent string unless the site was included in the <a href="http://msdn.microsoft.com/en-us/library/dd567845(v=vs.85).aspx">compatibility view list</a>. If your web page is doing <a href="http://msdn.microsoft.com/en-us/magazine/hh475813.aspx">browser sniffing</a> via the user agent string, you could encounter rendering differences or errors.

The WebBrowser control can only support the document modes available for the installed browser version on the client. If the client has IE 8 installed, a compatibility meta tag with the value of “IE=10” would default to the highest mode available of 8. You could consider defining multiple document modes and allow the control to pick the highest available document mode. However, your content would need to render correctly in the different modes.

Here’s an example page with the following compatibility meta tag: <em>&lt;meta http-equiv="X-UA-Compatible" content="IE=10,9,8,7"&gt;</em>

Here is the example app running on a client with IE 11 installed:

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3833.image_1B2630A5.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3755.image_thumb_56E5C958.png" alt="image" width="404" height="209" border="0" /></a>

Because of the compatibility meta tag, the highest document mode specified “10” is chosen.

Here is the example app running on a client with IE 8 installed:

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1602.image_4FC68CE0.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6153.image_thumb_2FAB8023.png" alt="image" width="404" height="206" border="0" /></a>

Since the highest available document mode is 8, the content is displayed in document mode 8.
<h3>FEATURE_BROWSER_EMULATION Registry Key</h3>
<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4747.registry_0466E91C.png"><img style="float: right;padding-top: 0px;padding-left: 0px;margin: 0px 12px;padding-right: 0px;border-width: 0px" title="registry" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3264.registry_thumb_4430CFA1.png" alt="registry" width="164" height="204" align="right" border="0" /></a> If you need to target a specific version of the browser, you may consider using the <a href="http://msdn.microsoft.com/en-us/library/ie/ee330730(v=vs.85).aspx#browser_emulation">FEATURE_BROWSER_EMULATION registry key</a>. This option may work for scenarios where you have a line of business application that has specific content such as help files or an internal web site. The registry key allows you to set a different default document mode for the WebBrowser control for a given application.

<strong>Note:</strong> Be careful when modifying the registry. You should only use this key for applications you compile. Modifying the behavior of an application you didn't create may affect the functionality of the application.
<h4>32-bit and 64-bit Complexities</h4>
You have the option to add the browser emulation key to the current user (HKCU) or the local machine ((HKLM) hive. If you add to the current user HKCU hive, you don’t need to worry about “bitness” of your OS or application.  However, if you add the key to the local machine hive, you need to consider the following complexities. Depending on the “bitness” of your application, you need to add the key to the correct registry location on a Windows 64-bit machine. On a 64-bit OS, 32-bit applications run in the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa384249(v=vs.85).aspx">WOW64 subsystem</a>. For 32-bit apps, <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa384232(v=vs.85).aspx">WOW64 redirects registry calls</a> to a separate location for certain keys. The FEATURE_BROWSER_EMULATION key is redirected. Therefore, on a 64-bit OS, a 32-bit application’s value needs to be placed in <em>HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION.</em>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7485.image_18EC389A.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8156.image_thumb_1F9F421D.png" alt="image" width="404" height="99" border="0" /></a>

In this case, we are always requesting the content to be displayed using document mode 10 and ignores the !DOCTYPE for the page.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/0636.image_2D718818.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6835.image_thumb_7864F8E7.png" alt="image" width="404" height="194" border="0" /></a>

If you’re wondering if your app is a 32-bit app running on a 64-bit OS, you can quickly verify by checking Task Manager.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3782.image_3424919B.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4452.image_thumb_661C3225.png" alt="image" width="404" height="194" border="0" /></a>

32-bit applications running on a 64-bit OS will have “(32 bit)” after the name.
<h4>What’s the Difference Between a Setting that Ignores the !DOCTYPE and the One that Doesn’t?</h4>
When you pick one of the settings that ignore the !DOCTYPE, the user agent string matches the requested document mode.  In the following example, the FEATURE_BROWSER_EMULATION value is 10000. This ignores the !DOCTYPE.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2548.image_21DBCAD9.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3443.image_thumb_102151B0.png" alt="image" width="404" height="194" border="0" /></a>

<strong>Note:</strong> The browser control sends a IE 10 user agent string.

If we choose a setting that looks for a standards doctype, the browser control sends the default standards based user agent string.  In the following example, the FEATURE_BROWSER_EMULATION value is 10001.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1882.image_4BE0EA63.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5280.image_thumb_2B59AAB1.png" alt="image" width="404" height="246" border="0" /></a>

<strong>Note</strong>: The browser control sends the default standards based user agent string. In this case, IE 11 is installed on the client. Therefore, the user agent string is an IE 11 user agent string.
<h4>What Happens if I Set the FEATURE_BROWSER_EMULATION Document Mode Value Higher than the IE Version on the Client?</h4>
Obviously, the browser control can only support a document mode that is less than or equal to the IE version installed on the client.   Using the FEATURE_BROWSER_EMULATION key works best for enterprise line of business apps where there is a deployed and support version of the browser. In the case you set the value to a browser mode that is a higher version than the browser version installed on the client, the browser control will choose the highest document mode available.

Here is an example of setting the value to 9000 on a client that has IE 8 installed.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4213.image_001513AA.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4135.image_thumb_5FFA06EC.png" alt="image" width="404" height="169" border="0" /></a>

We can see that the browser control displays the content in the highest available document mode of 8.
<h4>Does the Compatibility View List or Enterprise Mode Affect the Behavior of the WebBrowser Control?</h4>
Compatibility View list and Enterprise mode are features of the full Internet Explorer (iexplore.exe). Therefore, the web browser control does not support the Compatibility View list or Enterprise mode.
<h4>Debugging Your WebBrowser Control App in Visual Studio</h4>
The FEATURE_BROWSER_EMULATION key values require the executable name. If you are debugging your app in Visual Studio, your app is being hosted in Visual Studio. Therefore, you need an entry for the host.  Task manager details can help determine what the value should be named.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7367.image_1BB99FA0.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5224.image_thumb_4DB1402A.png" alt="image" width="404" height="24" border="0" /></a>

Based on this information, the app is 32-bit and the executable name is “EmbeddedIE.vshost.exe”. Therefore, the value needs to be added to Wow6432Node and name is “EmbeddedIE.vshost.exe”.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3073.image_2D96336D.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2806.image_thumb_421B82EB.png" alt="image" width="404" height="161" border="0" /></a>

Otherwise, you will see different behavior when debugging verses launching the executable.
<h2>Using IE to Determine what Document Mode You Need</h2>
The Emulation F12 development tool is very handy for determining what document mode you might need for your content.

In IE, just press F12 and select the “Emulation” tool.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7608.image_3AFC4673.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6622.image_thumb_28B37FB1.png" alt="image" width="404" height="202" border="0" /></a>

Using the Document mode setting, you can change the document mode to quickly see how the page would be rendered in a different mode. You can also change the User agent string to investigate how the server will respond to different user agent strings.]]></content:encoded>
    </item>
    <item>
      <title>How Do I Deploy a Windows 8 App to Another Device for Testing?</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/how-do-i-deploy-a-windows-8-app-to-another-device-for-testing</link>
      <pubDate>Mon, 05 Nov 2012 14:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2012/11/05/how-do-i-deploy-a-windows-8-app-to-another-device-for-testing/</guid>
      <description><![CDATA[If your developing a new Windows 8 app and you want to test it on another device (e.g. Surface),...]]></description>
      <content:encoded><![CDATA[<p>If your developing a new Windows 8 app and you want to test it on another device (e.g. Surface), you&rsquo;ll need to use a technique called sideloading. This can easily be done through a few steps that I&rsquo;ll describe in this post.</p>
<h1>What is Sideloading?</h1>
<p>Windows 8 Store Apps are deployed through the Windows Store.&nbsp; This may seem like an obvious statement. However, by default, <em>only</em> Windows Store apps are permitted to install and run on Windows 8. When you install an app from the Windows Store, a Windows Store signed app package is downloaded and installed on your machine. Since only Windows Store signed apps are permitted to be executed on Windows 8, it greatly reduces the introduction of malware. For development and enterprise scenarios, you can use a technique called sideloading to install and run apps that are not Windows Store signed. I&rsquo;ll cover development sideloading in this post. If you are interested in how to use sideloading for line of business apps in an enterprise, <a href="http://blogs.msdn.com/b/windowsstore/archive/2012/04/25/deploying-metro-style-apps-to-businesses.aspx">please see this post</a>.</p>
<h1>Development Sideloading</h1>
<p>Development sideloading is used by Visual Studio to deploy, debug and test your app.</p>
<p>The general requirements for sideloading are:</p>
<ol>
<li>Your appx package needs to be signed.</li>
<li>The certificate used for signing needs to be trusted.</li>
<li>A policy (or registry key) needs to be set to allow trusted apps to run.</li>
</ol>
<p>On a development machine, these requirements are automatically met for you by Visual Studio. Visual Studio provides a self-signing test certificate that is used to sign the package. Also, when Visual Studio is installed, a registry key is set to allow trusted apps to run. Therefore, when you debug a Windows 8 Store app using Visual Studio, the app is test certificate signed, deployed, and allowed to run.</p>
<h2>How do I Sideload My App on Another PC or ARM Device?</h2>
<p>In order to deploy an app, you need an <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh464929.aspx">App Package</a>. Visual Studio has functionality to create an App Package you can use to deploy your app to another machine. The following steps are how to create a local App Package.</p>
<ol>
<li>In Visual Studio Express 2012, choose &ldquo;Create App Package&rdquo; in the Store menu. <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1856.image_7395DB9D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/1856.image_5F00_7395DB9D.png"><img style="display: inline; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2437.image_thumb_1F74D20C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/2437.image_5F00_thumb_5F00_1F74D20C.png" alt="image" width="244" height="196" border="0" /></a>&nbsp; <br />Note: In Visual Studio 2012 Ultimate, the Store menu is in a different location. In the &ldquo;Project&rdquo; menu, use the &ldquo;Store&rdquo; option .</li>
<li>In the Create App Package wizard, you will want to create a local package. Therefore, answer &ldquo;No&rdquo; to the &ldquo;Do you want to build a package to upload to the Windows Store&rdquo;. Notice the information text indicates this is the option for sideloading. <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/0272.image_1D6675C2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/0272.image_5F00_1D6675C2.png"><img style="display: inline; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5707.image_thumb_01F0163E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/5707.image_5F00_thumb_5F00_01F0163E.png" alt="image" width="628" height="484" border="0" /></a></li>
<li>The next dialog provides a choice of processor platforms to target. In most cases, you would want to choose &ldquo;Any CPU&rdquo;. This will allow you to target all of the processor platforms and architectures. However, if you are using platform specific binaries in your app, you&rsquo;ll need to build separate packages for each platform.<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1016.image_7B6B392C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/1016.image_5F00_7B6B392C.png"> <br /><img style="display: inline; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4401.image_thumb_2B547D6D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/4401.image_5F00_thumb_5F00_2B547D6D.png" alt="image" width="628" height="484" border="0" /></a></li>
<li>In my example, I&rsquo;ll just leave the default &ldquo;Any CPU&rdquo; and click &ldquo;Create&rdquo; <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1425.image_104A50DE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/1425.image_5F00_104A50DE.png"><img style="display: inline; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8637.image_thumb_7540244E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/8637.image_5F00_thumb_5F00_7540244E.png" alt="image" width="628" height="484" border="0" /></a> <br />Note the wizard gives us a link to where the package was created.</li>
</ol>
<p>&nbsp;</p>
<p>If we click the link, here is an example of what was created:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2627.image_7331C804.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/2627.image_5F00_7331C804.png"><img style="display: inline; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1488.image_thumb_3F2BCB30.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/1488.image_5F00_thumb_5F00_3F2BCB30.png" alt="image" width="644" height="143" border="0" /></a></p>
<p>Here is a quick summary of the relevant files in the package directory:</p>
<p><strong>Appx package (MyApp_1.0.0.0_AnyCPU_Debug.appx)</strong></p>
<p>The appx package is a zip file of all of the program files for your app. This file gets deployed and installed into Windows. Try renaming the extension to &ldquo;.zip&rdquo; and open the zip file to see what is inside. Don&rsquo;t forget to change it back before you try and deploy it.</p>
<p><strong>Developer test certificate (MyApp_1.0.0.0_AnyCPU_Debug.cer)</strong></p>
<p>This is your development certificate. This is the certificate that was used to sign the appx package.</p>
<p><strong>PowerShell</strong> <strong>script (Add-AppDevPackage.ps1)</strong></p>
<p>This PowerShell script can be used to install the development certificate and install the App.</p>
<h3>&nbsp;</h3>
<h3>Installing the App on the Target Machine</h3>
<p>Everything you need to deploy the app is included in the package directory created by Visual Studio. I usually copy the directory to a USB memory stick to transfer the app to the target machine. On the target machine, you just need to run the PowerShell script (Add-AppDevPackage.ps1) to deploy the app. You can do this easily by right clicking on the script and selecting &ldquo;Run with PowerShell&rdquo;.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1373.image_6B0AC19E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/1373.image_5F00_6B0AC19E.png"><img style="display: inline; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1376.image_thumb_22134257.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/1376.image_5F00_thumb_5F00_22134257.png" alt="image" width="244" height="87" border="0" /></a></p>
<p>The first action performed by the script is to install the certificate. It needs to run elevated in order to perform this step. If PowerShell isn&rsquo;t running elevated, the script will prompt to start an elevated process to install the certificate.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7585.image_3900B652.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/7585.image_5F00_3900B652.png"><img style="display: inline; border: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6765.image_thumb_12CCFF79.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/6765.image_5F00_thumb_5F00_12CCFF79.png" alt="image" width="644" height="106" border="0" /></a></p>
<p>You will be warned and prompted to allow the certificate to be installed.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1263.image_5DEE9CBA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/1263.image_5F00_5DEE9CBA.png"><img style="display: inline; border: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7077.image_thumb_29E89FE6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/7077.image_5F00_thumb_5F00_29E89FE6.png" alt="image" width="644" height="126" border="0" /></a></p>
<p>Once the certificate is installed, the app package is installed.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1057.image_0EDE7357.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/1057.image_5F00_0EDE7357.png"><img style="display: inline; border: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4034.image_thumb_73D446C7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/4034.image_5F00_thumb_5F00_73D446C7.png" alt="image" width="244" height="61" border="0" /></a></p>
<p>&nbsp;Your app should now be installed on the target machine. You should be able to find the tile on the Start screen (usually at the end of the list):</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4452.image_2ADCC780.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/4452.image_5F00_2ADCC780.png"><img style="display: inline; border: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4048.image_thumb_7AE1187D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/4048.image_5F00_thumb_5F00_7AE1187D.png" alt="image" width="244" height="238" border="0" /></a></p>
<p>The final requirement is to allow trusted apps to run. If your target machine has Visual Studio installed, this requirement will already be met. However, if you don&rsquo;t have Visual Studio installed, you can meet the requirement through group policy or setting a registry key.&nbsp; For development purposes, it&rsquo;s usually easiest to set the registry key.</p>
<ul>
<li>Use RegEdit to navigate to the key: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Appx</li>
<li>Set AllowAllTrustedApps (REG_DWORD) to the value of 1</li>
</ul>
<p>Your app should now run on the target machine.</p>
<p>One final note&hellip; <em>This is the process for development sideloading</em>. There is a more formal process for enterprise sideloading.&nbsp; If you are interested in enterprise sideloading, <a href="http://blogs.msdn.com/b/windowsstore/archive/2012/04/25/deploying-metro-style-apps-to-businesses.aspx">please start with this post</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Developing a Native Win32 Application for Windows 7 Touch</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/developing-a-native-win32-application-for-windows-7-touch</link>
      <pubDate>Wed, 04 May 2011 17:18:34 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2011/05/04/developing-a-native-win32-application-for-windows-7-touch/</guid>
      <description><![CDATA[In a previous post, I discussed pros and cons of different development platforms for Windows 7 touch...]]></description>
      <content:encoded><![CDATA[<p>In a previous <a href="http://blogs.msdn.com/b/patricka/archive/2011/04/21/development-platforms-for-windows-7-touch.aspx">post</a>, I discussed pros and cons of different development platforms for Windows 7 touch applications. In this post, I’ll continue elaborating on each development environment&#160; and discuss common development considerations and issues for a touch application when using native C++.&#160; If you haven’t read the <a href="http://archive.msdn.microsoft.com/wintouchguide">Windows Touch Guidance</a> whitepaper, please review this document for good general guidance on developing a touch application. Note: Some of this base material is repeated from my <a href="http://blogs.msdn.com/b/patricka/archive/2011/04/29/developing-a-wpf-application-for-windows-7-touch.aspx">WPF post</a>.</p>  <h2>How Much “Touch” is Enough?</h2>  <p>One benefit of Windows touch is single touch and multitouch gestures are converted to mouse messages if they aren’t handled explicitly by your application. Therefore, your application may be somewhat touch friendly already. Depending on the touch scenario you want to support, you may only need to tweak your application in a few areas and be able to provide a good touch user experience. A good reference to explain what makes an application touch “friendly”, “enabled” or “optimized” is the <a href="http://msdn.microsoft.com/en-us/library/cc872774.aspx">MSDN Touch Guidelines</a>.</p>  <p>For the remainder of this post, I’ll focus on key touch considerations and suggest ways to implement using native C++.</p>  <h2>Touch Input Panel (TIP)</h2>  <p>The <a href="http://windowssummit.tri-digital.com/video-gallery/system/sys-t121.aspx">TIP</a> can be very handy if you want to allow users to enter text without a keyboard. Several “slate” PC’s now exist and either have an external keyboard or allow the user to configure the notebook to hide the keyboard. The TIP has existed since Tablet PC edition and is available in all versions of Windows 7. For native code, the TIP is displayed when the system caret is displayed.</p>  <p>Here is sample code that displays the system caret in a window if you click the left mouse button.</p>  <pre class="csharpcode">CreateCaret(hWnd, NULL, 5, 20);
xPos = LOWORD(lParam); 
yPos = HIWORD(lParam);

SetCaretPos(xPos,yPos);
ShowCaret(hWnd);</pre>


<p>This is the behavior in an application: 
  <br /></p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3113.SetCaret_1AADE6E4.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/3113.SetCaret_5F00_1AADE6E4.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SetCaret" border="0" alt="SetCaret" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5344.SetCaret_thumb_7A26A731.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/5344.SetCaret_5F00_thumb_5F00_7A26A731.jpg" width="244" height="228" /></a></p>

<p>Since the TIP is displayed when the caret is displayed, most native controls that allow text entry will display the TIP.&#160; If you are planning on using DirectX, the TIP will not display in full screen mode. You will need to implement your own text entry for full-screen mode DirectX applications.</p>

<h2>Screen Orientation and Rotation</h2>

<p>The <a href="http://msdn.microsoft.com/en-us/windows/hardware/gg487456.aspx">Windows 7 Engineering Guidance for Slate PCs</a> recommends PC’s to enable screen rotation automatically through sensors or a manual hardware button. If you plan on targeting mobile touch PC’s, you should consider supporting screen rotation for your touch application. To support rotation, you generally detect the screen dimensions have changed and then change the layout. If your application supports window resizing, you can leverage that same functionality for screen orientation and rotation.</p>

<p>For native C++ applications, you can determine landscape or portrait orientation by using the <a href="http://msdn.microsoft.com/en-us/library/ms724385.aspx">GetSystemMetrics</a> function to retrieve the height and width of the full screen. For screen rotation, you can listen for the <a href="http://msdn.microsoft.com/en-us/library/ms534847.aspx">WM_DISPLAYCHANGE</a> message in your&#160; <a href="http://msdn.microsoft.com/en-us/library/ms633573.aspx">WindowProc</a> function's switch statement.&#160; For code samples on detecting screen orientation and rotation, see <a href="http://msdn.microsoft.com/en-us/library/ms812142.aspx">Detecting Screen Orientation and Screen Rotation in Tablet PC Applications</a>. </p>

<h2>Gestures, Manipulations, and Inertia</h2>

<p>Developing in native C++ allows you full access to all of the Windows 7 touch API’s. Therefore, you can implement simple gestures or very complex custom manipulations.&#160; Here’s a quick summary of each item.</p>

<ul>
  <li>For raw touch information, you&#160; can register your application to receive <a href="http://msdn.microsoft.com/en-us/library/dd317341(VS.85).aspx">WM_TOUCH</a> messages. WM_TOUCH messages combine down, up, move and other states into one message. </li>

  <li>If you plan on just implementing well know gestures such as pinch zoom, rotate, pan, etc., you can use the <a href="http://msdn.microsoft.com/en-us/library/dd353242(v=VS.85).aspx">WM_GESTURE</a> message which is generated for common gestures.</li>

  <li>For manipulations, the application needs to implement the <a href="http://msdn.microsoft.com/en-us/library/dd372579(v=VS.85).aspx">IManipulationProcessor</a> interface. </li>

  <li>For inertia, the <a href="http://msdn.microsoft.com/en-us/library/dd372061(v=VS.85).aspx">IInertiaProcessor</a> interface can be used in conjunction with the IManipulationProcessor interface.</li>
</ul>

<p>One of the best resources for native touch development the <a href="http://msdn.microsoft.com/en-us/library/dd562197(v=VS.85).aspx">Touch topic</a> in the Windows Platform SDK.&#160; Also be sure to review the <a href="http://msdn.microsoft.com/en-us/library/dd562199(v=VS.85).aspx">SDK samples on touch</a> as well.</p>]]></content:encoded>
    </item>
    <item>
      <title>Developing a WPF Application for Windows 7 Touch</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/developing-a-wpf-application-for-windows-7-touch</link>
      <pubDate>Fri, 29 Apr 2011 14:52:00 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2011/04/29/developing-a-wpf-application-for-windows-7-touch/</guid>
      <description><![CDATA[In my previous post, I discussed pros and cons of different development platforms for Windows 7...]]></description>
      <content:encoded><![CDATA[<p>In my previous <a href="http://blogs.msdn.com/b/patricka/archive/2011/04/21/development-platforms-for-windows-7-touch.aspx">post</a>, I discussed pros and cons of different development platforms for Windows 7 touch applications. In this post, my goal is to discuss common development considerations and issues for a touch application when using WPF.&nbsp; If you haven&rsquo;t read the <a href="http://archive.msdn.microsoft.com/wintouchguide">Windows Touch Guidance</a> whitepaper, please review this document for good general guidance on developing a touch application.</p>
<h2>How Much &ldquo;Touch&rdquo; is Enough?</h2>
<p>One benefit of Windows touch is single touch and multitouch gestures are converted to mouse messages if they aren&rsquo;t handled explicitly by your application. Therefore, your application may be somewhat touch friendly already.&nbsp; Depending on the touch scenario you want to support, you may only need to tweak your application in a few areas and be able to provide a good touch user experience. A good reference to explain what makes an application touch &ldquo;friendly&rdquo;, &ldquo;enabled&rdquo; or &ldquo;optimized&rdquo; is the <a href="http://msdn.microsoft.com/en-us/library/cc872774.aspx">MSDN Touch Guidelines</a>.</p>
<p>For the remainder of this post, I&rsquo;ll focus on key touch considerations and suggest ways to implement using WPF.</p>
<h2>Text Input Panel (TIP)</h2>
<p>The <a href="http://windowssummit.tri-digital.com/video-gallery/system/sys-t121.aspx">TIP</a> can be very handy if you want to allow users to enter text without a keyboard. Several &ldquo;slate&rdquo; PC&rsquo;s now exist and either have an external keyboard or allow the user to configure the notebook to hide the keyboard. The TIP has existed since Tablet PC edition and is available in all versions of Windows 7. WPF will display the TIP automatically for most controls such as the TextBox control. If you touch the TextBox, you will see a TIP icon.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7103.TipIcon_32BFAB15.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/7103.TipIcon_5F00_32BFAB15.jpg"><img height="151" width="244" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8664.TipIcon_thumb_24813225.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/8664.TipIcon_5F00_thumb_5F00_24813225.jpg" alt="TipIcon" border="0" title="TipIcon" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" /></a></p>
<p>If you touch the TIP icon, the virtual keyboard is displayed</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8270.TipKeyboard_32537820.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/8270.TipKeyboard_5F00_32537820.jpg"><img height="352" width="554" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5140.TipKeyboard_thumb_1CF5C2B8.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/5140.TipKeyboard_5F00_thumb_5F00_1CF5C2B8.jpg" alt="TipKeyboard" border="0" title="TipKeyboard" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" /></a></p>
<p>Almost all of WPF&rsquo;s controls that accept text entry support TIP. However, PasswordBox does not support TIP. You will want to avoid using PasswordBox or implement your own way to input passwords without a keyboard.</p>
<h2>Screen Rotation</h2>
<p>The <a href="http://msdn.microsoft.com/en-us/windows/hardware/gg487456.aspx">Windows 7 Engineering Guidance for Slate PCs</a> recommends PC&rsquo;s to enable screen rotation automatically through sensors or a manual hardware button. If you plan on targeting mobile touch PC&rsquo;s, you should consider supporting screen rotation for your touch application. To support rotation, you generally detect the screen dimensions have changed and then change the layout.</p>
<p>One way to detect a screen rotation is to register for the <a href="http://msdn.microsoft.com/en-us/library/microsoft.win32.systemevents.displaysettingschanged.aspx">DisplaySettingsChanged</a> event.&nbsp; The following is some sample code that registers for the DisplaySettingsChanged event. The DisplaySettingsChanged handler changes the Window title and size of a WrapPanel to change the control layout.</p>
<pre class="csharpcode"><span class="kwrd">public</span> MainWindow()
{
    Microsoft.Win32.SystemEvents.DisplaySettingsChanged +=<span class="kwrd">new</span> System.EventHandler(displaySettingsChanged);
}

<span class="kwrd">private</span> <span class="kwrd">void</span> displaySettingsChanged(<span class="kwrd">object</span> sender, EventArgs e)
{
    <span class="kwrd">if</span> (System.Windows.SystemParameters.PrimaryScreenHeight &gt; System.Windows.SystemParameters.PrimaryScreenWidth)
    {
        <span class="rem">//Run the application in portrait</span>

        <span class="kwrd">this</span>.Title = <span class="str">"Portrait View"</span>;
        wrapPanel1.Width = 600;
        wrapPanel1.Height = 800;
    }
    <span class="kwrd">else</span>
    {
        <span class="rem">//Run the application in landscape</span>

        <span class="kwrd">this</span>.Title = <span class="str">"Landscape View"</span>;
        wrapPanel1.Width = 800;
        wrapPanel1.Height = 600;
    }
}</pre>

<p>&nbsp;</p>
<p><strong>Landscape view:</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4786.Landscape_75BB7982.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/4786.Landscape_5F00_75BB7982.jpg"><img height="213" width="554" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3718.Landscape_thumb_6372B2C0.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/3718.Landscape_5F00_thumb_5F00_6372B2C0.jpg" alt="Landscape" border="0" title="Landscape" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" /></a></p>
<p><strong>Portrait view:</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3884.Portrait_7144F8BB.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/3884.Portrait_5F00_7144F8BB.jpg"><img height="419" width="554" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6521.Portrait_thumb_1C1D5CCE.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-08-metablogapi/6521.Portrait_5F00_thumb_5F00_1C1D5CCE.jpg" alt="Portrait" border="0" title="Portrait" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" /></a></p>
<p>For more information on detecting screen rotation, see <a href="http://msdn.microsoft.com/en-us/library/ms812142.aspx" title="Detecting Screen Orientation and Screen Rotation in Tablet PC Applications">Detecting Screen Orientation and Screen Rotation in Tablet PC Applications</a>.&nbsp;</p>
<h2>Gestures, Manipulations, and Inertia</h2>
<p>WPF is one of the easiest Windows development platforms that enable touch manipulation of objects.&nbsp; The <a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement.aspx">UIElement</a>, <a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement3d.aspx">UIElement3D</a>, and <a href="http://msdn.microsoft.com/en-us/library/system.windows.contentelement.aspx">ContentElement</a> classes expose events that occur when a user touches an element. Several other controls support touch-enabled scrolling. The <a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement.aspx">UIElement</a> supports manipulation which is interpreted to scale, rotate, or translate. I won&rsquo;t go into the details of implementing manipulations within this post because there is great information on this already. To get started, please review <a href="http://technet.microsoft.com/en-us/library/ee649090.aspx">Walkthrough: Creating Your First Touch Application</a> on TechNet.</p>]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting Interactive Services Detection</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/troubleshooting-interactive-services-detection</link>
      <pubDate>Mon, 14 Mar 2011 16:58:00 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2011/03/14/troubleshooting-interactive-services-detection/</guid>
      <description><![CDATA[My earlier post on Interactive Services Detection is very popular. It was targeted toward...]]></description>
      <content:encoded><![CDATA[My earlier post on Interactive Services Detection is very popular. It was targeted toward developers.  Based on the comments I receive, I think most readers are users looking for some help.  If you’re a developer, make sure to check out my previous <a href="http://blogs.msdn.com/b/patricka/archive/2010/04/27/what-is-interactive-services-detection-and-why-is-it-blinking-at-me.aspx">post</a>. If you are just a user trying to figure out why Interactive Services Detection is blinking at you and how to possibly troubleshoot the issue, this post is for you.
<h2>Why is this happening (when I boot; every 5 minutes; intermittently)?</h2>
First, some background… There are two main types of “processes” that run on Windows – desktop applications and services.

<strong>Desktop</strong> <strong>applications</strong> "interact" with the user through a user interface (windows, dialogs, etc.).

<strong>Services</strong> run in the "background" and do system stuff and communicate with other applications.

Services should not interact with the user. Windows 7 and Vista have a boundary that isolates services from trying to interact with the user. If the service tries to present some kind of user interface, you will get the Interactive Service Detection flashing toolbar button.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6433.ISDButton_27F20684.png"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px" title="ISDButton" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6507.ISDButton_thumb_53C25A73.png" alt="ISDButton" width="94" height="59" border="0" /></a>

There could be a couple of reasons why this is occurring. However in most cases, the service experienced an “<a href="http://en.wikipedia.org/wiki/Unhandled_exception">unhandled exception</a>”. Unhandled exceptions are errors that the programmer didn’t expect and didn’t handle with code. Most people call this a “crash”.

Services generally start at boot time. Therefore, if the service is crashing when it starts, you will see the interactive services detection button at boot time. If you ignore the notification or select “Ask me later”, Interactive Services Detection will notify you again in 5 minutes.

If you only see the Interactive Services Detection intermittently, this is very likely the service crashing due to some unexpected condition. For example, I have 3rd party printer software on my personal laptop that crashes occasionally and I get a Interactive Services Detection notification. I’ll keep the brand name of the printer to myself <img class="wlEmoticon wlEmoticon-winkingsmile" style="border-style: none" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4454.wlEmoticon-winkingsmile_37B19B88.png" alt="Winking smile" />.
<h2>Identifying the Service</h2>
As a user, your best option is to identify what service is causing the notification. If you know what software is causing the notification, you can check the manufacturer’s website for an update or contact support.

The first thing to inspect is the Interactive Services Detection dialog. Be sure to click the “Show Program Details” button.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8270.ISDDialog_4583E183.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px" title="ISDDialog" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6102.ISDDialog_thumb_7E2E8B90.jpg" alt="ISDDialog" width="512" height="484" border="0" /></a>

This is a message from a service I created that has an intentional unhandled exception. If you look at the “Program path” this can give you some clues about the service that is crashing. The path can give you the company name, application, and most importantly the executable name. In most cases, you can search for the executable name (e.g. UISampleService.exe) using your favorite search engine.
<h2>More Clues</h2>
Next, you should select “View the Message”.  This will take you to the “secured desktop” where you can read the message.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7510.CrashDialog_1DDD6559.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px" title="CrashDialog" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2313.CrashDialog_thumb_5DA74BDE.jpg" alt="CrashDialog" width="479" height="285" border="0" /></a>

Here we can see some additional information about the crash. Collect this information and try searching using some of this information. If this was a real application, I would type the following into a search engine: <strong>UISampleService.exe “Microsoft Visual C++ Debug Library” R6010 “abort() has been called”</strong> and see if you can find any support articles, fixes, discussions, or updates for the issue.

If you can’t find anything with a search, you may want to consider contacting support for the product that is having the issue.  Keep all the information you collected so far to pass along to the support engineer.  Also, feel free to point the support engineer to this blog. <img class="wlEmoticon wlEmoticon-smile" style="border-style: none" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3884.wlEmoticon-smile_1D713264.png" alt="Smile" />
<h2>Even More Clues…</h2>
If it is a crash that is causing the issue, you may also want to investigate what information is being collected.  The best way to see the history of the problem is with Reliability Monitor. Type “reliability” in the Start menu search box and click the “View reliability history” link.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5353.StartReliability_4C95C25C.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px" title="StartReliability" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8233.StartReliability_thumb_0BF375ED.jpg" alt="StartReliability" width="201" height="244" border="0" /></a>

This utility allows you to see the history of all the issues on your computer. If a service is crashing, it should show up here. We can see that there is an entry for my sample crashing service, UISampleService.exe.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7343.ReliabilityMonitor_6FE2B701.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px" title="ReliabilityMonitor" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1055.ReliabilityMonitor_thumb_4F5B774F.jpg" alt="ReliabilityMonitor" width="528" height="484" border="0" /></a>

In this utility, you can identify when and how often the crash is occurring. You may want to try the “Check for a solution” action for the error.  This will check to see if the application vendor posted a solution for this issue on the Windows Error Reporting system.
<h2>The Tile Button is Displayed Too Quickly and I Can't Click it Fast Enough</h2>
I received this question a few times in the comments. Great question! Here's a technique you can use to troubleshoot the issue. You will need to create a custom view in the event viewer.

From the Start menu search box, type <strong>eventvwr</strong> to start the Event Viewer.

In the tree view in the left pane, right click <strong>Custom Views</strong> and select <strong>Create Custom View...</strong>

In the Custom View dialog, select the "By Source" radio button and then select<strong> Interactive Services detection</strong> in the "Event sources" drop down box.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/0385.CustomView.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/0385.CustomView.PNG" alt="" border="0" /></a>

Click <strong>Ok</strong>. In the "Save Filter" dialog, name your custom view. e.g. "Interactive Services Detection". Click <strong>OK. </strong>You are now configured to capture these events when the occur.

If you ever see the Interactive Services Detection tile appear on the taskbar, you can return to the Event Viewer (eventvwr) and investigate the information that has been logged. Here is an example event where I "tricked" calculator to run in session 0 to cause the issue.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/4604.EventVwr.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/4604.EventVwr.PNG" alt="" border="0" /></a>
<h2>Can I Disable the Notification?</h2>
The short answer is yes but it is not recommended. The likely reason for the notification is there is something wrong with a service on your computer. You can disable the notification but you are not fixing the problem. Some good analogies would be putting black tape over the “Check Engine” warning light on your car dashboard or removing the battery from your smoke detector.

The Interactive Services Detection notification is initiated by the Interactive Services Detection Service. If you disable this service, you will no longer receive the notification for the problem service. Also, you will not receive notification for any misbehaving service on your system.

To disable the service, open the Services control panel by typing <strong>services.msc</strong> in the Start menu search box.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7181.StartServices_2B43785F.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px" title="StartServices" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8270.StartServices_thumb_1D04FF6F.jpg" alt="StartServices" width="202" height="244" border="0" /></a>

In the Services control panel, find “Interactive Services Detection” in the list. Click the “stop” button to stop it if it is started.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6840.ServicesControlPanel_43D315AF.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px" title="ServicesControlPanel" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3718.ServicesControlPanel_thumb_4366E2BA.jpg" alt="ServicesControlPanel" width="644" height="220" border="0" /></a>

Double click the Interactive Services Detection entry to open the Properties dialog. Set the “Startup type” to <strong>Disabled</strong>.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3806.UI0DetectProperties_311E1BF8.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px" title="UI0DetectProperties" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6114.UI0DetectProperties_thumb_54D74392.jpg" alt="UI0DetectProperties" width="464" height="484" border="0" /></a>

You are now blissfully unaware of any misbehaving services.]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting Application Compatibility Issues – Tools, Tips, and Tricks</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/troubleshooting-application-compatibility-issues-tools-tips-and-tricks</link>
      <pubDate>Tue, 30 Nov 2010 21:43:00 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2010/11/30/troubleshooting-application-compatibility-issues-tools-tips-and-tricks/</guid>
      <description><![CDATA[When I need to troubleshoot a compatibility problem, there are a handful of tools that I use that...]]></description>
      <content:encoded><![CDATA[<p>When I need to troubleshoot a compatibility problem, there are a handful of tools that I use that are very helpful. In this post, I&rsquo;ll talk about some of my favorite tools and how to use them to identify compatibility issues. </p>
<p>Most applications do a poor job of reporting unexpected errors. A lot of times, the developer didn&rsquo;t plan for the error and it gets bubbled up as a misleading error or a crash to the user. Compatibility issues tend to fall in the unexpected category.&nbsp; I&rsquo;ve categorized the usual causes of these expected issues and the troubleshooting tools I use.</p>
<h2>UAC: Permission Issues</h2>
<p>Application compatibility permission issues are usually a result of applications not being designed for standard user. The <a href="http://blogs.msdn.com/b/patricka/archive/2010/05/13/if-i-m-an-administrator-why-do-i-get-access-denied.aspx">application assumes that the user has full administrator privileges</a> and has issues running with User Account Control (UAC) enabled.</p>
<p><a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">Process Monitor</a> is the first tool you should use in identifying a possible permission issue. Process Monitor logs all file and registry activity (among other things). This can be very handy when looking for a permission issue.&nbsp; </p>
<p>Start Process Monitor prior to the issue occurring.&nbsp; Make sure you are capturing at least the file and registry activity.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8816.ProcMon-Start_57979250.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/8816.ProcMon_2D00_Start_5F00_57979250.jpg"><img height="144" width="486" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6837.ProcMon-Start_thumb_3B1AA070.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/6837.ProcMon_2D00_Start_5F00_thumb_5F00_3B1AA070.jpg" alt="ProcMon Start" border="0" title="ProcMon Start" style="display: inline; border-width: 0px;" /></a> </p>
<p>Since this tool logs everything that is happing on the system, make sure to take advantage of the filtering feature.&nbsp; You may want to filter on PID or Process Name.&nbsp; For example, I&rsquo;m only including the process name &ldquo;legacyUAC.exe&rdquo;.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6431.ProcMonFilter_5AC97A38.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/6431.ProcMonFilter_5F00_5AC97A38.jpg"><img height="281" width="504" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3782.ProcMonFilter_thumb_766E062E.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/3782.ProcMonFilter_5F00_thumb_5F00_766E062E.jpg" alt="ProcMon Filter" border="0" title="ProcMon Filter" style="display: inline; border-width: 0px;" /></a> </p>
<p><strong>Tips:</strong></p>
<ul>
<li>You probably have a good idea about what file or registry is giving you a problem.&nbsp; You can use the &ldquo;find&rdquo; function <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/0181.ProcMon-find_3637ECB4.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/0181.ProcMon_2D00_find_5F00_3637ECB4.jpg"><img height="28" width="29" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6036.ProcMon-find_thumb_012B5D84.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/6036.ProcMon_2D00_find_5F00_thumb_5F00_012B5D84.jpg" alt="ProcMon find" border="0" title="ProcMon find" style="display: inline; border-width: 0px;" /></a> to find the file or key. </li>
<li>Permission issues tend to return a status of &ldquo;ACCESS DENIED&rdquo;.&nbsp; Try adding a filter for &ldquo;Result is ACCESS DENIED&rdquo;: <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7827.ProcMonfilteraccessdenied_7601D339.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/7827.ProcMonfilteraccessdenied_5F00_7601D339.jpg"><img height="38" width="444" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3125.ProcMonfilteraccessdenied_thumb_59F1144E.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/3125.ProcMonfilteraccessdenied_5F00_thumb_5F00_59F1144E.jpg" alt="ProcMon filter access denied" border="0" title="ProcMon filter access denied" style="display: inline; border-width: 0px;" /></a> </li>
<li>UAC virtualization will be indicated by a result of &ldquo;REPARSE&rdquo; followed buy a log entry to the virtual store location.&nbsp; See this post for <a href="http://blogs.msdn.com/b/patricka/archive/2009/12/14/tales-of-application-compatibility-weirdness-demystifying-uac-virtualization.aspx">details on UAC virtualization</a>. </li>
<li>Sometimes highlighting can be more useful than filtering. For example, you may want to see the log entries that occur around the same time as another log entry.&nbsp; REPARSE is a good example.&nbsp; Highlighting works like filtering.&nbsp; You can get to the highlighting dialog from the menu. A shortcut to add highlighting (and filtering) is to right click on the column/row and add the highlight condition. <br />&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2543.ProcMon-highlight_67C35A49.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/2543.ProcMon_2D00_highlight_5F00_67C35A49.jpg"><img height="209" width="244" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6837.ProcMon-highlight_thumb_278D40CF.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/6837.ProcMon_2D00_highlight_5F00_thumb_5F00_278D40CF.jpg" alt="ProcMon highlight" border="0" title="ProcMon highlight" style="display: inline; border-width: 0px;" /></a> </li>
</ul>
<h2>UAC: Integrity Level Issues</h2>
<p>If you have applications that communicate to other processes especially via Windows messages, you may run into <a href="http://blogs.msdn.com/b/patricka/archive/2010/01/28/q-why-doesn-t-drag-and-drop-work-when-my-application-is-running-elevated-a-mandatory-integrity-control-and-uipi.aspx">Mandatory Integrity Level (MIC) issues</a>. </p>
<p><a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx">Process Explorer</a> is a great tool for a lot of troubleshooting tasks. If you need to see at what integrity level a process is executing, Process Explorer has a column that reports the integrity level of running processes. Simply check &ldquo;Integrity Level&rdquo; under View | Select Columns&hellip; in the menu. Here&rsquo;s an example screenshot:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1663.ProcExpintegrity_4E5B570F.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/1663.ProcExpintegrity_5F00_4E5B570F.jpg"><img height="344" width="644" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2046.ProcExpintegrity_thumb_0706011D.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/2046.ProcExpintegrity_5F00_thumb_5F00_0706011D.jpg" alt="ProcExp integrity" border="0" title="ProcExp integrity" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a> </p>
<h2>Version Checking Issues</h2>
<p><a href="http://blogs.msdn.com/b/patricka/archive/2010/01/14/common-problems-with-checking-os-versions-in-code.aspx" title="Version Checking issues are a very common compatibility issue">Version Checking issues are a very common compatibility issue</a>. Applications will check the OS version and make decisions on whether to run or exit, use certain APIs, perform functionality, etc. Depending on how the version check logic is written, the code may make an incorrect choice on a new OS Version.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=C4A25AB9-649D-4A1B-B4A7-C9D8B095DF18&amp;displaylang=en">Application Verifier</a> is one of the best tools to &ldquo;lie&rdquo; about the OS version to an application. Application Verifier intercepts Windows version API&rsquo;s and returns any version number you want to specify.&nbsp; So, if I&rsquo;m having an issue, I can set the version number to a previous OS to verify I have a version checking issue. </p>
<p>Just add your application to the application list Application Verifier will monitor and test.&nbsp; Check the HighVersionLie test <strong>only</strong> for version checking. Application Verifier has a lot of test that focus on reliability.&nbsp; You may get unexpected crashes if you do some of the default memory tests.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8816.AppVerifier_348720E0.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/8816.AppVerifier_5F00_348720E0.jpg"><img height="316" width="504" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5367.AppVerifier_thumb_74510765.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/5367.AppVerifier_5F00_thumb_5F00_74510765.jpg" alt="AppVerifier" border="0" title="AppVerifier" style="display: inline; border-width: 0px;" /></a> </p>
<p>By default, the HighVersionLie test increments the major and minor OS version numbers by 2.&nbsp; Windows 7 is version 6.1. Therefore, you application will think it&rsquo;s running on OS version 8.3. Here&rsquo;s sample output from my legacyVersion sample app:</p>
<p><span style="font-family: Courier New;">&gt;legacyVersion.exe <br />OS Version using GetVersion (Major.Minor.Build): 8.3.8600 <br />OS Version using GetVersionEx (Major.Minor.Build): 8.3.8600 </span></p>
<p><span style="font-family: Courier New;">MajorVersion==5 is FALSE. I'm NOT Win2000 or XP <br />MajorVersion==5 &amp;&amp; MinorVersion==1 is FALSE. I'm NOT XP <br />MajorVersion==6 is FALSE. I'm NOT Vista <br />MajorVersion==6 &amp;&amp; MinorVersion==0 is FALSE. I'm NOT Vista <br />MajorVersion&gt;=5 &amp;&amp; MinorVersion&gt;=1. I'm XP or greater </span></p>
<p><span style="font-family: Courier New;">*** Most correct version check *** <br />MajorVersion&gt;=6 &amp;&amp; MinorVersion&gt;=0. I'm Vista or greater</span></p>
<p>If you want to test some other version number, right click the HighVersionLie test and select properties.&nbsp; Enter the version you want to test:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4784.AppVerifier-version_341AEDEB.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/4784.AppVerifier_2D00_version_5F00_341AEDEB.jpg"><img height="289" width="524" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8507.AppVerifier-version_thumb_5EF351FD.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/8507.AppVerifier_2D00_version_5F00_thumb_5F00_5EF351FD.jpg" alt="AppVerifier version" border="0" title="AppVerifier version" style="display: inline; border-width: 0px;" /></a> </p>
<p><strong>Note:</strong> Application Verifier always attaches to the applications in its list regardless if the UI is active. Remember to delete the application from the list when you are done troubleshooting.</p>
<p>The nice thing about Application Verifier is that you can set the version number to anything. This can be useful in determining if your app has any version checking issues on a future OS. By default, the HighVersionLie test increments both the major and minor version numbers by 2.</p>
<h2>Checking Manifests</h2>
<p><a href="http://technet.microsoft.com/en-us/sysinternals/bb897441.aspx">Sigcheck</a> is a signature checking tool. However, the &ndash;m switch allows you to dump the manifest. This is a quick way to see an application manifest for an executable.</p>
<p>The application manifest is a resource in the executable. You can also use a resource editor to view the manifest. With a resource editor, you could also modify the manifest which could help in debugging the issue.&nbsp; For more information on manifests, <a href="http://blogs.msdn.com/b/patricka/archive/2009/12/09/answers-to-several-application-manifest-mysteries-and-questions.aspx">see my manifest post</a>.</p>
<h2>Performance</h2>
<p>If you are trying to uncover a performance issue, <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx">Process Explorer</a> can help you narrow down the issue quickly.&nbsp; I run Process Explorer with the system tray icons.&nbsp; This allows you to monitor thumbnail performance graphs for the system.&nbsp; If you notice a high value or spike, you can hover over the icon and get a possible clue of what might be causing the issue.&nbsp; In this screenshot, you can see I hovered over the CPU icon and we see the suspicious application CPUHog.exe consuming 49% of the total CPU.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8510.ProcExp-tray-icons_33AEBAF6.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/8510.ProcExp_2D00_tray_2D00_icons_5F00_33AEBAF6.jpg"><img height="70" width="244" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5466.ProcExp-tray-icons_thumb_2C8F7E7E.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/5466.ProcExp_2D00_tray_2D00_icons_5F00_thumb_5F00_2C8F7E7E.jpg" alt="ProcExp tray icons" border="0" title="ProcExp tray icons" style="display: inline; border-width: 0px;" /></a> </p>
<p>To turn on the tray icons, select the icons you would like to see from the Options menu.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/3113.ProcExp-tray-icons-option_0C7471C1.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/3113.ProcExp_2D00_tray_2D00_icons_2D00_option_5F00_0C7471C1.jpg"><img height="278" width="424" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/4606.ProcExp-tray-icons-option_thumb_13277B44.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/4606.ProcExp_2D00_tray_2D00_icons_2D00_option_5F00_thumb_5F00_13277B44.jpg" alt="ProcExp tray icons option" border="0" title="ProcExp tray icons option" style="display: inline; border-width: 0px;" /></a> </p>
<p>Another handy performance option in Process Explorer is to use the&nbsp; CPU History columns&nbsp; This will show the CPU history graph for all processes.&nbsp; This can be useful if you have intermittent CPU spikes. Just add the CPU History column in the View | Select Columns menu.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8004.ProcExp-CPU-History-Column_6BED320E.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/8004.ProcExp_2D00_CPU_2D00_History_2D00_Column_5F00_6BED320E.jpg"><img height="151" width="644" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6431.ProcExp-CPU-History-Column_thumb_0B9C0BD7.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/6431.ProcExp_2D00_CPU_2D00_History_2D00_Column_5F00_thumb_5F00_0B9C0BD7.jpg" alt="ProcExp CPU History Column" border="0" title="ProcExp CPU History Column" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a></p>
<p>If you need advanced performance analysis, you can use XPerf in the <a href="http://msdn.microsoft.com/en-us/performance/cc825801.aspx">Windows Performance Toolkit (WPT).</a> XPerf allows you to capture and view Windows event data for everything that is going on in the operating system. This is a very powerful tool that you can obtain very detailed information. It may take some practice before you get proficient with this tool.</p>
<h2>Boot Performance</h2>
<p>If you are encountering slow boot times, you may need to analyze what is in the boot path to pinpoint the problem. Process Monitor provides a quick and easy way to log boot time activity.</p>
<p>Select Options | Enable Boot Logging</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/0676.ProcMon-boot-logging_79534514.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/0676.ProcMon_2D00_boot_2D00_logging_5F00_79534514.jpg"><img height="195" width="244" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5861.ProcMon-boot-logging_thumb_391D2B9A.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/5861.ProcMon_2D00_boot_2D00_logging_5F00_thumb_5F00_391D2B9A.jpg" alt="ProcMon boot logging" border="0" title="ProcMon boot logging" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" /></a></p>
<p>This will log the file, registry, profiling information during your next boot.&nbsp; You can then review the log to identify possible applications that are consuming a lot of resources during the boot cycle.</p>
<p>If you are interested in in depth boot performance analysis, you can use the Windows Performance Toolkit (WPT).&nbsp; See the <a href="http://www.microsoft.com/whdc/system/sysperf/On-Off_Transition.mspx">Windows On/Off Transition Performance Analysis whitepaper</a> for details on how to use WPT to analyze boot performance.</p>
<h2>Crashes</h2>
<p>For crashes, you will need to use a debugger. I generally use <a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx">WinDbg</a>. </p>
<p>If you can reproduce the crash, don&rsquo;t dismiss the crash dialog.&nbsp; By leaving the dialog, the process still exists and you can attach to the process with the debugger and diagnose the exception.&nbsp; </p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/5270.image_1D0C6CAF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/5270.image_5F00_1D0C6CAF.png"><img height="132" width="244" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/1072.image_thumb_5CD65334.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/1072.image_5F00_thumb_5F00_5CD65334.png" alt="image" border="0" title="image" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a></p>
<p>Press F6 and attach to the process.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/8422.Windbg-attach_1CA039BA.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/8422.Windbg_2D00_attach_5F00_1CA039BA.jpg"><img height="484" width="384" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/7848.Windbg-attach_thumb_03383680.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/7848.Windbg_2D00_attach_5F00_thumb_5F00_03383680.jpg" alt="Windbg attach" border="0" title="Windbg attach" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a></p>
<p>Ideally, you can load your symbols at this point.&nbsp; If you have debug symbols for the application, the debugger can give you more information about the exception. Once you have your symbols loaded, try a !analyze &ndash;v command.&nbsp; The debugger will try to give you some analysis of the exception.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2555.windbg-analyze_5BFDED4A.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/2555.windbg_2D00_analyze_5F00_5BFDED4A.jpg"><img height="382" width="644" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/2543.windbg-analyze_thumb_227ADD53.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/2543.windbg_2D00_analyze_5F00_thumb_5F00_227ADD53.jpg" alt="windbg analyze" border="0" title="windbg analyze" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a></p>
<p>In this case, it looks like we have an invalid argument.</p>
<h3>Saving dumps</h3>
<p>Sometimes, you may want to save dumps for analysis later.&nbsp; Maybe it&rsquo;s on a non-development machine or you want to collect several dumps. You can configure Windows 7 and Windows Server 2008 R2 to always generate and save a dump file.</p>
<ul>
<li>Create a key named: HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps</li>
<li>Dumps will default to the following directory: %LOCALAPPDATA%\CrashDumps</li>
<li>You can override the default with a DumpFolder value (REG_EXPAND_SZ)</li>
<li>You can also limit the number of dumps saved with a DumpCount value (DWORD)</li>
</ul>
<p>For more info see: <a href="http://blogs.technet.com/b/askperf/archive/2008/02/05/ws2008-windows-error-reporting.aspx">http://blogs.technet.com/b/askperf/archive/2008/02/05/ws2008-windows-error-reporting.aspx</a></p>
<h2>What about Hangs?</h2>
<p>For hangs, the first tool I uses is Process Explorer. If an application is slow and unresponsive, I start Process Explorer and use crosshair on the toolbar and drag and drop on to the unresponsive window.&nbsp; This will highlight the process in the list. I then double click the process in the list and then look at the Threads tab. You can then double click the threads to look at the stack.&nbsp; This usually points you in the right direction. Here we can see that in CPUHog.exe, the tightLoop routine is probably a good place to start looking for an issue:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/6378.procexp-stack-trace_4FFBFD16.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/6378.procexp_2D00_stack_2D00_trace_5F00_4FFBFD16.jpg"><img height="367" width="644" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/08/metablogapi/0676.procexp-stack-trace_thumb_41BD8426.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-99-08-metablogapi/0676.procexp_2D00_stack_2D00_trace_5F00_thumb_5F00_41BD8426.jpg" alt="procexp stack trace" border="0" title="procexp stack trace" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a></p>
<h2>Error codes</h2>
<p>Sometimes it&rsquo;s easy to forget that there&rsquo;s a tool to look up error codes. Err.exe in the SDK. This utility can be used to look up what the description for a particular code. Err.exe uses error codes defined in header files. It exists in the Bin directory of the SDK. e.g. C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin.</p>
<p>For example, let&rsquo;s look up error code 5.</p>
<p><span style="font-family: Courier New; font-size: x-small;">C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin&gt;err 5 <br /># for hex 0x5 / decimal 5 <br />&nbsp; BTH_ERROR_AUTHENTICATION_FAILURE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bthdef.h <br />&nbsp; INVALID_PROCESS_ATTACH_ATTEMPT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bugcodes.h <br />&nbsp; CDERR_LOADSTRFAILURE&nbsp;&nbsp;&nbsp;&n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># given string is too long <br />&nbsp; KDC_ERR_S_OLD_MAST_KVNO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kerberr.h <br /># 5 Server's key encrypted in old master key <br />&nbsp; RSVP_Err_BAD_STYLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lpmapi.h <br /># /* Conflicting style&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */ <br />&nbsp; POLICY_ERRV_IDENTITY_CHANGED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lpmapi.h <br />&nbsp; POLICY_ERRV_SUBNET_DEF_FLOW_COUNT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; winldap.h <br />&nbsp; SNMP_ERROR_GENERR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; winsnmp.h <br /># as an HRESULT: Severity: SUCCESS (0), FACILITY_NULL (0x0), Code 0x5 <br /># for hex 0x5 / decimal 5 <br />&nbsp; ERROR_ACCESS_DENIED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; winerror.h <br /># Access is denied.</span></p>
<p>We can see there are lots of definitions for the error code of 5. Depending on what header files you include in your code, you can figure out what the actual error is.&nbsp; If you don&rsquo;t have access to the code, you can usually make an educated guess on which error you are encountering.</p>
<p>&nbsp;</p>
<p>I hit on most of the tools I use to solve most of the issues I&rsquo;ve seen.&nbsp; I really hope this helps you find issues and be able to solve them.</p>
<p>Pat</p>]]></content:encoded>
    </item>
    <item>
      <title>If I’m an Administrator, Why Do I Get Access Denied?</title>
      <link>https://docs.microsoft.com/archive/blogs/patricka/if-im-an-administrator-why-do-i-get-access-denied</link>
      <pubDate>Thu, 13 May 2010 21:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Pat Altimore MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/patricka/2010/05/13/if-im-an-administrator-why-do-i-get-access-denied/</guid>
      <description><![CDATA[User Account Control (UAC) can seem mysterious. After all, if I’m a member of the Administrators...]]></description>
      <content:encoded><![CDATA[User Account Control (UAC) can seem mysterious. After all, if I’m a member of the Administrators group, shouldn’t I have access to everything?  If you’re a developer, you’ll run into a UAC issue sooner or later.  In this post, I’ll cover the basics that every developer should know.
<h2>Standard User by Default</h2>
Running applications as “<a href="http://windows.microsoft.com/en-US/windows-vista/What-is-a-standard-user-account">Standard User</a>” by default is what UAC is all about. Running processes with as few rights and privileges as possible is a common security <a href="http://en.wikipedia.org/wiki/Defense_in_Depth_%28computing%29">defense in depth</a> technique. UAC accomplishes this during the logon process. The traditional NT security model created a single <a href="http://msdn.microsoft.com/en-us/library/Aa374909.aspx">access token</a> at logon that all processes on the desktop use. The token contained privileges based on the groups the logged on user belonged.  With UAC enabled, the logon process creates the traditional “full” token and also creates a limited “filtered” token.  The filtered token contains only “standard user” privileges.

Here’s a slide to help illustrate the “by default” part.
<p align="left"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_2.png"><img style="border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_thumb.png" alt="image" width="727" height="540" border="0" /></a></p>
<p align="left">The magic happens when explorer.exe is started using the filtered token.  Explorer.exe is your taskbar and is responsible for starting everything on the desktop. By default, child processes are started with the same token as their parent. Therefore, since explorer.exe is started with the filtered token, everything that is launched by the taskbar is <strong>standard user by default</strong> (<a href="http://encarta.msn.com/dictionary_1861737085/presto.html">presto</a>!).</p>
<p align="left"><em>Bonus question</em>: What token is used to start explorer.exe with UAC disabled? <em>Answer</em>: The full administrator token.  This is why Windows 7 (and Vista) behave like traditional NT with UAC disabled.</p>
<p align="left">What if you want to use the full token?  You can run you application elevated (right click and select “Run as Administrator”). This will start the application with the full token instead of the filtered token. As an application developer, if you have a good reason to always start an application with the full token, you would <a href="http://blogs.msdn.com/patricka/archive/2009/12/09/answers-to-several-application-manifest-mysteries-and-questions.aspx">set the appropriate run level in the manifest</a>.</p>
<p align="left">Let’s take a look at two different command prompts to illustrate this concept.</p>
<p align="left">The following is a command prompt started from the taskbar:</p>
<p align="left"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_8.png"><img style="border: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_thumb_3.png" alt="image" width="641" height="316" border="0" /></a></p>
<p align="left">The following is a elevated command prompt started from the taskbar via right clicking and choosing “Run as Administrator”:</p>
<p align="left"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_10.png"><img style="border: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_thumb_4.png" alt="image" width="641" height="466" border="0" /></a></p>
<p align="left">We can see that the user name and the SID are identical.  However, the non-elevated command prompt only has the privileges of a standard user.</p>

<h2>What’s a Standard User?</h2>
A standard user is only allowed to change their own settings and environment (per user).  An administrator can change system wide settings (per machine). Here’s a table of examples of what you can and can’t do as a standard user:
<table style="width: 601px" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="299"><strong><span style="text-decoration: underline">Allowed</span></strong></td>
<td valign="top" width="300"><strong><span style="text-decoration: underline">Not Allowed</span></strong></td>
</tr>
<tr>
<td valign="top" width="299">Run most applications</td>
<td valign="top" width="300">Install applications</td>
</tr>
<tr>
<td valign="top" width="299">Change per user settings</td>
<td valign="top" width="300">Change system components</td>
</tr>
<tr>
<td valign="top" width="299">Read from per user and per machine locations</td>
<td valign="top" width="300">Change per machine settings</td>
</tr>
<tr>
<td valign="top" width="299">Create local objects</td>
<td valign="top" width="300">Perform operations requiring Admin privileges</td>
</tr>
<tr>
<td valign="top" width="299"></td>
<td valign="top" width="300">Write to per machine locations</td>
</tr>
<tr>
<td valign="top" width="299"></td>
<td valign="top" width="300">Create global objects</td>
</tr>
</tbody>
</table>
&nbsp;

Just by simply limiting the scope of changes a user/application can perform can have a big impact on security, reliability, and stability of a machine. Enterprise guys who manage lots of desktops like the concept of standard user because it helps lower their <a href="http://en.wikipedia.org/wiki/Total_cost_of_ownership">TCO</a>.
<h2>Finding UAC Issues</h2>
The first step to determine if you have a UAC issue is to try running the application elevated (right click – Run as Administrator). You can also try turning UAC off.  If your application works in one of these scenarios, you probably have a UAC issue.

UAC issues are caused by an application trying to make a change system wide. This means it’s trying to write to a per machine location or create something globally across all users.

Is your application trying to:
<ul>
	<li>Write to Program Files, Windows, System32, HKLM/Software, or Root?</li>
	<li>Create anything “globally” like a memory mapped file?</li>
	<li>Send Windows messages between an app running as standard user to one running elevated? (See: <a href="http://blogs.msdn.com/patricka/archive/2010/01/28/q-why-doesn-t-drag-and-drop-work-when-my-application-is-running-elevated-a-mandatory-integrity-control-and-uipi.aspx">this post</a>)</li>
</ul>
If so, this is where to start looking for the problem.

After you have an idea of where the problem might be, <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">Process Monitor</a> is a great tool to start isolating the issue.  Process Monitor will log all file and registry activity and will usually point you in the right direction.

Here’s a snip from a Process Monitor log where an application is trying to write to the HKLM hive in the registry. HKLM is protected by UAC and <a href="http://msdn.microsoft.com/en-us/library/bb625957.aspx">Mandatory Integrity Control</a> (MIC).  Therefore, you will get an Access Denied:

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_6.png"><img style="border: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_thumb_2.png" alt="image" width="644" height="24" border="0" /></a>

We can see in the log what key is trying to be opened for write and the result of ACCESS DENIED.

Looking for UAC issues can be tricky. You need to watch out for UAC Virtualization as well.  UAC Virtualization may allow your program to avoid access denied errors. However, when you manifest your app, it will disable this mitigation. See my post on <a href="http://blogs.msdn.com/patricka/archive/2009/12/14/tales-of-application-compatibility-weirdness-demystifying-uac-virtualization.aspx">Demystifying UAC Virtualization</a>.

Here’s a sample app trying to write junk.txt to Program Files. Program Files is protected by UAC and MIC. However, the program doesn’t fail because of UAC Virtualization in this case:

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_4.png"><img style="border-width: 0px" title="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/patricka/WindowsLiveWriter/ExplainUserAccountControlin10Minutes_A1CA/image_thumb_1.png" alt="image" width="644" height="47" border="0" /></a>

We see that we try to write to Program Files but get a “REPARSE” result. This is UAC Virtualization intercepting the access denied. We then see the file being written to the virtual store instead.
<h2>Next Steps</h2>
The goal of this post was to give you a base understanding of UAC from a developer perspective. UAC is a really big topic. There’s a lot of good resources. Here are some of my favorites:

<a href="http://msdn.microsoft.com/en-us/library/aa480152.aspx">Application Compatibility Cookbook: User Account Control</a>

<a href="http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx">Inside Windows Vista User Account Control</a> – Read this one first :-)

<a href="http://technet.microsoft.com/en-us/magazine/2009.07.uac.aspx">Inside Windows 7 User Account Control</a>

<a href="http://msdn.microsoft.com/en-us/library/aa511445.aspx">MSDN: User Account Control</a>]]></content:encoded>
    </item>
  </channel>
</rss>