<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AB-WebLog.com&#187; Microsoft</title>
	<atom:link href="http://www.ab-weblog.com/en/tag/microsoft/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ab-weblog.com/en</link>
	<description>Andreas Breitschopp</description>
	<lastBuildDate>Wed, 18 Mar 2015 09:47:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Windows 8 App Excellence Lab</title>
		<link>http://www.ab-weblog.com/en/windows-8-app-excellence-lab/</link>
		<comments>http://www.ab-weblog.com/en/windows-8-app-excellence-lab/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 13:28:58 +0000</pubDate>
		<dc:creator>Andreas Breitschopp</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[Metro]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.ab-weblog.com/en/?p=488</guid>
		<description><![CDATA[Today I attended a Windows 8 App Excellence Lab in the Microsoft office in Unterschleißheim near Munich (Germany). It was very interesting to talk with a Microsoft developer about the requirements that needs to be met for a Metro style &#8230; <a href="http://www.ab-weblog.com/en/windows-8-app-excellence-lab/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I attended a Windows 8 App Excellence Lab in the Microsoft office in Unterschleißheim near Munich (Germany).</p>
<p>It was very interesting to talk with a Microsoft developer about the requirements that needs to be met for a Metro style app in the Windows 8 app store. There are very high standards especially regarding the look &amp; feel of the application.</p>
<p>At the moment I especially want to get a HTML5-based vocabulary trainer ready for Windows 8. As a result of this App Excellence Lab I got a token that I can use to register at the Windows 8 app store before the official start. Additionally registration is free with this token for two years.</p>
<p><em>Did you attend to a Windows 8 App Excellence Lab, too?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ab-weblog.com/en/windows-8-app-excellence-lab/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Attending Windows 8 Camp</title>
		<link>http://www.ab-weblog.com/en/attending-windows-8-camp/</link>
		<comments>http://www.ab-weblog.com/en/attending-windows-8-camp/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 19:04:43 +0000</pubDate>
		<dc:creator>Andreas Breitschopp</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[Metro]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.ab-weblog.com/en/?p=481</guid>
		<description><![CDATA[Today I attended to the Windows 8 Camp in the German Microsoft main office in Unterschleißheim near Munich. The speaker explained some details about the new operating system and especially the new Metro apps from a developer perspective. Although it &#8230; <a href="http://www.ab-weblog.com/en/attending-windows-8-camp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I attended to the Windows 8 Camp in the German Microsoft main office in Unterschleißheim near Munich.</p>
<p>The speaker explained some details about the new operating system and especially the new Metro apps from a developer perspective. Although it still was interesting, I expected some more new information in such a seminar.</p>
<p>Anyway, it was great to meet some friends again and catering was good, too. <img src='http://www.ab-weblog.com/en/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><em>Did you attend to this event, too?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ab-weblog.com/en/attending-windows-8-camp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Visual Studio Form Designer With Forms Extending Abstract Classes</title>
		<link>http://www.ab-weblog.com/en/using-visual-studio-form-designer-with-forms-extending-abstract-classes/</link>
		<comments>http://www.ab-weblog.com/en/using-visual-studio-form-designer-with-forms-extending-abstract-classes/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 13:31:18 +0000</pubDate>
		<dc:creator>Andreas Breitschopp</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[form designer]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.ab-weblog.com/en/?p=315</guid>
		<description><![CDATA[For a recent project I wanted to create an abstract form base class. This way some global functionality can be inherited by all of my forms and interface methods can be defined. But the result was this error message as &#8230; <a href="http://www.ab-weblog.com/en/using-visual-studio-form-designer-with-forms-extending-abstract-classes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For a recent project I wanted to create an abstract form base class. This way some global functionality can be inherited by all of my forms and interface methods can be defined.</p>
<p>But the result was this error message as soon as I tried to open one of my derived from classes in the Visual Studio form designer:</p>
<pre class="brush: text; gutter: false">The designer must create an instance of type &lt;type name&gt;, but it can't because the type is declared as abstract.</pre>
<p>Hereupon I&#8217;ve searched for a solution in the web and it seems that I was not the only one that had the idea to derive some form classes from an abstract base class. To solve the problem I&#8217;ve created a dummy implementation of my abstract base class and derived the form classes from this dummy implementation. This way the form classes can be displayed in the Visual Studio form designer again.</p>
<p>In C# the classes look like this then:</p>
<pre class="brush: csharp; gutter: true">public abstract partial class BaseForm : Form
{
  // Methods of your abstract class...
}

#if DEBUG
public class BaseFormImpl : BaseForm
{
  // The dummy implementation of the abstract BaseForm class.
}
#endif

#if DEBUG
public partial class RealForm : BaseFormImpl
#else
public partial class RealForm : BaseForm
#endif
{
  // One of the forms extending the base form.
}</pre>
<p>And for VB .NET developers it looks like this:</p>
<pre class="brush: vbnet; gutter: true">Public MustInherit Partial Class BaseForm
  Inherits Form
  ' Methods of the abstract base class...
End Class

#if DEBUG
Public Class BaseFormImpl
  Inherits BaseForm
  ' The dummy implementation of the abstract BaseForm class.
End Class
#endif

Public Partial Class RealForm
#if DEBUG
  Inherits BaseFormImpl
#else
  Inherits BaseForm
#endif
  ' One of the forms extending the base form.
End Class</pre>
<p>Probably you have noticed the compiler directives: obviously that&#8217;s not necessary that the forms work correctly inside the form designer again. But I don&#8217;t like to have unnecessary code inside the released product (and the dummy implementation of the abstract <em>BaseForm</em> class is really useless). Therefore I used these conditional compiler directives to make sure that this dummy class is only used in debug mode.</p>
<p><em>Did you come across this issue yourself already, too?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ab-weblog.com/en/using-visual-studio-form-designer-with-forms-extending-abstract-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing a Browser Toolbar: Microsoft Internet Explorer (3/5)</title>
		<link>http://www.ab-weblog.com/en/developing-a-browser-toolbar-microsoft-internet-explorer/</link>
		<comments>http://www.ab-weblog.com/en/developing-a-browser-toolbar-microsoft-internet-explorer/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 15:00:15 +0000</pubDate>
		<dc:creator>Andreas Breitschopp</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASPects]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[publication]]></category>
		<category><![CDATA[toolbar]]></category>

		<guid isPermaLink="false">http://www.ab-weblog.com/en/?p=291</guid>
		<description><![CDATA[This post series reflects my article &#8220;Developing a Browser Toolbar&#8221; published in the ASPects in January 2010 (Volume 23, Issue 1), a magazine of the Association of Shareware Professionals (ASP). The first decision to make is which programming language you &#8230; <a href="http://www.ab-weblog.com/en/developing-a-browser-toolbar-microsoft-internet-explorer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>This post series reflects my article &#8220;Developing a Browser Toolbar&#8221; published in the <a title="ASPects Website" href="http://www.asp-shareware.org/about/aspects.asp" target="_blank">ASPects</a> in January 2010 (Volume 23, Issue 1), a magazine of the <a title="Association of Shareware Professionals Website" href="http://www.asp-shareware.org" target="_blank">Association of Shareware Professionals</a> (ASP).</em></p>
<p>The first decision to make is which programming language you want to use for developing the Internet Explorer toolbar. I did some research in the web and found examples for C++, Visual Basic 6 and .NET. There seem to be some visual styles issues; it obviously does not look so good on Windows Vista and Windows 7 systems by using the C++ version. And as I really don&#8217;t like to develop in Visual Basic 6 anymore, I decided to go the .NET way. The only disadvantage of this decision is that the user needs to have the .NET Framework 2.0 (or higher) installed on the system. But I can live with that, because it is very common already.</p>
<p>Since almost all of my products are developed in .NET, I already had the Visual Studio 2008 installed on my computer. If not, you&#8217;ll need at least the <a title="Microsoft Visual Studio Express Edition Website" href="http://www.microsoft.com/express" target="_blank">Express Edition</a> (version 2005 should be enough, too) for the next steps. I decided to develop the toolbar in C#, but Visual Basic .NET could do the same thing, of course.</p>
<p>As a good starting point I found <a title="Extending Explorer With Band Objects Using .NET and Windows Forms" href="http://www.codeproject.com/KB/shell/dotnetbandobjects.aspx" target="_blank">this</a> and <a title="Internet Explorer Toolbar Creation" href="http://www.codeproject.com/KB/shell/IEToolbar.aspx" target="_blank">this</a> article at the Code Project webpage. If you want to read more about the COM component, you can also read the <a title="Internet Explorer Toolbar (Deskband) Tutorial" href="http://www.codeproject.com/KB/shell/ietoolbartutorial.aspx" target="_blank">C++ tutorial</a>, but that&#8217;s not necessarily needed. By using the demo source code of those articles you should get a working toolbar – at least on a Windows XP system. But there were some issues I came across that needed to be fixed and therefore I will describe them in more detail here:</p>
<h2>Making Toolbar Show up Correctly on All Operating Systems</h2>
<p>By using the demo code of the articles mentioned above, I got the toolbar to work quite fast on my Windows XP testing machine. I was naively thinking that if the toolbar works on Windows XP with Internet Explorer 8, it will also work on Windows Vista and Windows 7 with the same Internet Explorer version. But indeed, I had to learn that this is absolutely not the case! It either just does not show up at all or so far on the right side, that you can only see the toolbar if you have a horizontal resolution of at least 2,000 pixels. So I had to search for a solution, but most changes to the code resulted in the toolbar working either on the one or on the other operating system or browser version combination. After some hours of frustrated testing, I changed the <em>GetBandInfo</em> procedure of the <em>BandObjectsLib</em> class in the following way. Although I&#8217;m still not absolutely sure why, it works fine now on all operating system:</p>
<pre class="brush: csharp; gutter: true">public virtual void GetBandInfo(UInt32 dwBandID, UInt32 dwViewMode, ref DESKBANDINFO dbi)
{
    if ((dbi.dwMask &amp; DBIM.MINSIZE) != 0)
    {
        dbi.ptMinSize.X = this.MinimumSize.Width;
        dbi.ptMinSize.Y = this.MinimumSize.Height;
    }

    if ((dbi.dwMask &amp; DBIM.MAXSIZE) != 0)
    {
        dbi.ptMaxSize.X = this.MaximumSize.Width;
        dbi.ptMaxSize.Y = this.MaximumSize.Height;
    }

    if ((dbi.dwMask &amp; DBIM.ACTUAL) != 0)
    {
        dbi.ptActual.X = this.Size.Width;
        dbi.ptActual.Y = this.Size.Height;
    }

    if ((dbi.dwMask &amp; DBIM.BKCOLOR) != 0)
    {
        dbi.dwMask &amp;= ~DBIM.BKCOLOR;
    }

    dbi.dwModeFlags = DBIMF.BREAK;
}</pre>
<h2>Nicer Appearance on Windows XP and above</h2>
<p>If you don&#8217;t add the following event handler to the <em>BandObjectsLib</em> class, your toolbar will still work, but will just not look very good on Windows XP and above. The <em>if</em>-statement in the event function additionally makes sure that the toolbar still works on older operating systems like Windows 98, 2000 and ME. Otherwise it would throw an exception on these operating systems. Here is the code I&#8217;ve used to get it to work correctly on all operating systems:</p>
<pre class="brush: csharp; gutter: true">[DllImport("uxtheme", ExactSpelling = true)]
public extern static Int32 DrawThemeParentBackground(IntPtr hWnd, IntPtr hdc,
                                                     ref Rectangle pRect);

protected override void OnPaintBackground(PaintEventArgs e)
{
    if (System.Environment.OSVersion.Platform &gt;= PlatformID.Win32NT &amp;&amp;
           (Environment.OSVersion.Version.Major == 5 &amp;&amp;
            Environment.OSVersion.Version.Minor &gt;= 1 ||
            Environment.OSVersion.Version.Major &gt;= 6) &amp;&amp;
           this.BackColor == Color.Transparent)
    {
        // Only if operating system is Windows XP or higher
        IntPtr hdc = e.Graphics.GetHdc();
        Rectangle rec = new Rectangle(e.ClipRectangle.Left,
            e.ClipRectangle.Top, e.ClipRectangle.Width, e.ClipRectangle.Height);
        DrawThemeParentBackground(this.Handle, hdc, ref rec);
        e.Graphics.ReleaseHdc(hdc);
    }
    else
    {
        base.OnPaintBackground(e);
    }
}</pre>
<h2>No Serialization Allowed</h2>
<p>When developing a Firefox toolbar you can use the Mozilla preferences service to store and load user-defined values inside Firefox itself. Because there is no equivalent in Internet Explorer and I&#8217;m using XML serialization in many of my other .NET products, I wanted to use it in the toolbar project, too. This worked fine at first sight, but if the <em>Protected Mode</em> is enabled in Internet Explorer 8 (and it is by default, at least since Windows Vista), it shows an ugly warning dialog to the user whenever the toolbar is initialized. I won&#8217;t explain the reason in detail here, but just don&#8217;t use serialization in Internet Explorer toolbars. You can save user-defined values either without serialization in the file system below the local application data directory or simply by using the registry.</p>
<h2>Automatic Online Update</h2>
<p>As I did in the Firefox version, I also wanted the Internet Explorer toolbar to come with an automatic update feature. Because there is no update system for toolbars in Firefox, you have to implement it yourself. But this is quite easy, because you can use, as in any other .NET application, the <em>WebClient</em> class for doing a HTTP request to first ask if there is a new update available and then to receive the update file if needed. On the server side I have a small PHP script handling the update requests. The update file which is downloaded is the normal setup executable that just overrides all files with the new ones. The only thing you have to care about is the way you call the executable setup file after downloading, because otherwise a User Account Control (UAC) prompt will be shown. I&#8217;ve written this procedure that you can use for executing a file from within the toolbar code without any warning displayed to the user:</p>
<pre class="brush: csharp; gutter: true">private void startProcess(string fileName, string arguments)
{
    System.Diagnostics.ProcessStartInfo startInfo =
        new System.Diagnostics.ProcessStartInfo();
    startInfo.UseShellExecute = true;
    startInfo.WorkingDirectory = Environment.CurrentDirectory;
    startInfo.FileName = fileName;
    if (Environment.OSVersion.Platform &gt;= PlatformID.Win32NT &amp;&amp;
            Environment.OSVersion.Version.Major &gt;= 6)
        // Only if operating system is Windows Vista or higher
        startInfo.Verb = "runas";
    else
        startInfo.Verb = "open";
    startInfo.Arguments = arguments;
    startInfo.ErrorDialog = true;
    try
    {
        System.Diagnostics.Process process = System.Diagnostics.Process.Start(startInfo);
        process.WaitForExit();

        MessageBox.Show(objToolbarData["msg.restartBrowserText"],
                        objToolbarData["msg.restartBrowserTitle"],
                        MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    catch (Exception ex)
    {
        if (debugMode) MessageBox.Show(ex.ToString());
    }
}</pre>
<h2>Uninstall Button Inside the Toolbar</h2>
<p>That&#8217;s the only thing which is easier to implement in Internet Explorer than in Firefox; it is enough to call the uninstall executable (again with the <em>startProcess</em> procedure above) of the installation system (see next post###) to uninstall the toolbar again. It will disappear then after browser has been restarted (just as on Firefox).</p>
<p>It&#8217;s done; the Internet Explorer version of our toolbar is ready, too! It will work on Internet Explorer 6 or higher running on Windows 98 or higher with an installed .NET Framework 2.0.</p>
<p>In the <a title="Developing a Browser Toolbar: Installation System (4/5)" href="http://www.ab-weblog.com/en/developing-a-browser-toolbar-installation-system/">next post</a> I&#8217;ll explain how we get the toolbars installed.</p>
<h2>Contents of Post Series &#8220;Developing a Browser Toolbar&#8221;:</h2>
<ul>
<li><a title="Developing a Browser Toolbar: Introduction (1/5)" href="http://www.ab-weblog.com/en/developing-a-browser-toolbar-introduction/">Introduction</a></li>
<li><a title="Developing a Browser Toolbar: Mozilla Firefox (2/5)" href="http://www.ab-weblog.com/en/developing-a-browser-toolbar-mozilla-firefox-25/">Mozilla Firefox</a></li>
<li>Microsoft Internet Explorer</li>
<li><a title="Developing a Browser Toolbar: Installation System (4/5)" href="http://www.ab-weblog.com/en/developing-a-browser-toolbar-installation-system/">Installation System</a></li>
<li><a title="Developing a Browser Toolbar: Summary (5/5)" href="http://www.ab-weblog.com/en/developing-a-browser-toolbar-summary/">Summary</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ab-weblog.com/en/developing-a-browser-toolbar-microsoft-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->