<?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>Rick Brewster's blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/rickbrew/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/rickbrew/feed.xml</link>
    <description>Performance, Windows Forms, and UI</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:06:52 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Paint.NET blog has moved ! Also, there's a new BETA release (3.08)</title>
      <link>https://docs.microsoft.com/archive/blogs/rickbrew/paint-net-blog-has-moved-also-theres-a-new-beta-release-3-08</link>
      <pubDate>Tue, 29 May 2007 17:51:00 GMT</pubDate>
      <dc:creator><![CDATA[rickbrew]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rickbrew/2007/05/29/paint-net-blog-has-moved-also-theres-a-new-beta-release-3-08/</guid>
      <description><![CDATA[All future Paint.NET-related blog posts will now be posted at: http://blog.getpaint.net . If you are...]]></description>
      <content:encoded><![CDATA[<P>All future Paint.NET-related blog posts will now be posted at: <A href="http://blog.getpaint.net/">http://blog.getpaint.net</A> . If you are currently subscribed to this blog (that is, <A href="http://blogs.msdn.com/rickbrew" mce_href="http://blogs.msdn.com/rickbrew">http://blogs.msdn.com/rickbrew</A>) then I invite you to subscribe to this new one! I will still continue to post here for other topics.</P>
<P>Also, you'll see over there that a new beta release is available! <A href="http://blog.getpaint.net/2007/05/29/paintnet-v308-beta-is-now-available/">http://blog.getpaint.net/2007/05/29/paintnet-v308-beta-is-now-available/</A>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>RAM prices have sunk like a rock!</title>
      <link>https://docs.microsoft.com/archive/blogs/rickbrew/ram-prices-have-sunk-like-a-rock</link>
      <pubDate>Wed, 09 May 2007 14:22:00 GMT</pubDate>
      <dc:creator><![CDATA[rickbrew]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rickbrew/2007/05/09/ram-prices-have-sunk-like-a-rock/</guid>
      <description><![CDATA[http://www.newegg.com/Product/Product.aspx?Item=N82E16820134046
2GB of DDR2-667 memory for $86 is...]]></description>
      <content:encoded><![CDATA[<P><A href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820134046">http://www.newegg.com/Product/Product.aspx?Item=N82E16820134046</A></P>
<P>2GB of DDR2-667 memory for $86 is very nice!</P>
<P>I upgraded my media center PC this last weekend to a Core 2 Duo E4300. I was going to get 1 GB of RAM but the 2 GB kit was so cheap I thought, "why not?"</P>
<P>My&nbsp;media center used to have a 3GHz Pentium 4 chip in it, and it was a Prescott so it ran really&nbsp;hot and the fan noise was noticable. Now with the E4300 in there not only is it faster, but it's super quiet and doesn't run very hot at all. Plus, the chip was quite cheap, at around $115 on newegg (<A href="http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&amp;DEPA=0&amp;Description=E4300">http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&amp;DEPA=0&amp;Description=E4300</A>). And if you want it to run faster, just set the bus speed to 1066 and you've got it at 2.4 GHz :) I put a passively cooled eVGA GeForce 7600 GS in the system, which is perfect for the target noise level. And since I cancelled my cable TV (I just get TV shows from iTunes and XBOX Marketplace), I don't need the Hauppauge TV tuner cards anymore! Those things cluttered up the inside of the case and generated their fair share of heat as well.</P>
<P><EM>This post is made "AS IS" without warranties, and confers no rights.</EM></P>]]></content:encoded>
    </item>
    <item>
      <title>Problems installing Adobe Photoshop CS3 on Vista x64?</title>
      <link>https://docs.microsoft.com/archive/blogs/rickbrew/problems-installing-adobe-photoshop-cs3-on-vista-x64</link>
      <pubDate>Thu, 26 Apr 2007 18:22:00 GMT</pubDate>
      <dc:creator><![CDATA[rickbrew]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rickbrew/2007/04/26/problems-installing-adobe-photoshop-cs3-on-vista-x64/</guid>
      <description><![CDATA[So I went to install Photoshop CS3 on my Vista x64 box at home, and got this nice error:

Internal...]]></description>
      <content:encoded><![CDATA[<P>So I went to install Photoshop CS3 on my Vista x64 box at home, and got this nice error:</P>
<BLOCKQUOTE>
<P><STRONG>Internal Error 2739</STRONG></P></BLOCKQUOTE>
<P>Gee, thanks for the info. </P>
<P>Anyway I searched online for ways to fix this, and they involved running regsvr32.exe on jscript.dll and vbscript.dll. Unfortunately, <STRONG>it didn't work!</STRONG> However, I found someone online who had fixed it: <A href="http://davidgardiner.blogspot.com/2007/02/internal-error-2739-on-vista-x64.html" mce_href="http://davidgardiner.blogspot.com/2007/02/internal-error-2739-on-vista-x64.html">http://davidgardiner.blogspot.com/2007/02/internal-error-2739-on-vista-x64.html</A></P>
<P>David had the critical insight, one that I'm slapping myself on the forehead for not realizing myself: you need to register the 32-bit versions of vbscript and jscript, not the 64-bit versions. The Photoshop installer is a 32-bit program, and thus needs access to all 32-bit DLL's and COM registrations. The instructions that are around the web will register whatever is in your SYSTEM32 directory, which oddly enough on 64-bit Windows is where all the 64-bit DLL's are. (And another oddity on top of that is that the 32-bit DLL's are in SysWOW64. Go figure.)</P>
<P>The solution?</P>
<P>1) Run cmd.exe with Administrator privilege (Start -&gt; type "cmd", then right-click on the cmd.exe and select "Run as Administrator, then click Continue on the elevation consent dialog). This will open a command prompt in C:\Windows\System32 (or wherever your system directory is)</P>
<P>2) cd ..\SysWOW64</P>
<P>3) regsvr32 jscript.dll</P>
<P>4) regsvr32 vbscript.dll</P>
<P>Voila. Hope this helps anybody else who runs in to this.</P>]]></content:encoded>
    </item>
    <item>
      <title>I was interviewed! for DotNetRocks</title>
      <link>https://docs.microsoft.com/archive/blogs/rickbrew/i-was-interviewed-for-dotnetrocks</link>
      <pubDate>Tue, 17 Apr 2007 14:17:00 GMT</pubDate>
      <dc:creator><![CDATA[rickbrew]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rickbrew/2007/04/17/i-was-interviewed-for-dotnetrocks/</guid>
      <description><![CDATA[A few weeks ago they asked me to do an interview with them about Paint.NET, so I thought "Why...]]></description>
      <content:encoded><![CDATA[<P>A few weeks ago they asked me to do an interview with them about Paint.NET, so I thought "Why not?"</P>
<P>Anyway they've posted the interview today: <A href="http://www.dotnetrocks.com/default.aspx?showNum=229">http://www.dotnetrocks.com/default.aspx?showNum=229</A></P>
<P><IMG style="WIDTH: 140px; HEIGHT: 157px" height=157 src="http://www.dotnetrocks.com/dnr_photos/rickbrewster.jpg" width=140 mce_src="http://www.dotnetrocks.com/dnr_photos/rickbrewster.jpg"></P>]]></content:encoded>
    </item>
    <item>
      <title>Nine Inch Nails: Year Zero ... listen to it online NOW</title>
      <link>https://docs.microsoft.com/archive/blogs/rickbrew/nine-inch-nails-year-zero-listen-to-it-online-now</link>
      <pubDate>Wed, 04 Apr 2007 23:04:00 GMT</pubDate>
      <dc:creator><![CDATA[rickbrew]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rickbrew/2007/04/04/nine-inch-nails-year-zero-listen-to-it-online-now/</guid>
      <description><![CDATA[Ok so here's a completely new type of post from me. I've pretty much stuck to nerdy topics like...]]></description>
      <content:encoded><![CDATA[<P><IMG src="http://www.getpaint.net/misc/ninbarcode.png" mce_src="http://www.getpaint.net/misc/ninbarcode.png"></P>
<P>Ok so here's a completely new type of post from me. I've pretty much stuck to nerdy topics like Paint.NET, WinForms, and Performance over the last ~3 years.</P>
<P>But anyone who knows me personally knows I'm super stoked about the new Nine Inch Nails album, <EM>Year Zero</EM>. It's hitting stores on April 17th. I've got my pre-order and&nbsp;my lithograph, I went to the listening party in Seattle, etc. etc. This is my favorite band, and <EM>The Downward Spiral </EM>is a staple in my car's CD player.</P>
<P>And now you can listen to the full thing online, 2 weeks before it's available! Freaking awesome stuff.</P>
<P><FONT size=+2><A href="http://yearzero.nin.com/"><STRONG>http://yearzero.nin.com</STRONG></A></FONT> &lt;-- that's what you need to click on!</P>]]></content:encoded>
    </item>
    <item>
      <title>When the power goes out ...</title>
      <link>https://docs.microsoft.com/archive/blogs/rickbrew/when-the-power-goes-out</link>
      <pubDate>Tue, 19 Dec 2006 13:05:00 GMT</pubDate>
      <dc:creator><![CDATA[rickbrew]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rickbrew/2006/12/19/when-the-power-goes-out/</guid>
      <description><![CDATA[Like everyone else who lives on the eastside, my power got knocked out as part of the big huge...]]></description>
      <content:encoded><![CDATA[<P>Like everyone else who lives on the eastside, my power got knocked out as part of the big huge windstorm that hit the pacific northwest (if you haven't heard about it yet somehow: <A href="http://www.cnn.com/2006/WEATHER/12/19/northwest.storm.ap/index.html">http://www.cnn.com/2006/WEATHER/12/19/northwest.storm.ap/index.html</A>). Thing is, when the power goes out the problem is not just that your TV won't work: the roads are jammed because the intersection lights are out (all-way stop), cell phone reception is slim-to-none, and it gets cold really fast.</P>
<P>So imagine my elation when I heard that the Redmond campus had&nbsp;power&nbsp;restored on Saturday, while I was still in the dark at home. I grabbed some food, a gallon of milk, packed up my xbox360 ... and went to work! You see, at my building they have&nbsp; microwaves, kitchens, heat, Internet, and <EM>hot showers</EM>. I was able to spend the day occupied and entertained (Geometry Wars!).</P>
<P>&nbsp;Several other people were there with their families because it was a warm place to be. One guy I know is still without power and might not have it until Friday! So he's packed up&nbsp;his&nbsp;whole family and they're living at his office for the time being. This is definitely one of the unsung benefits of working at a place like Microsoft.</P>]]></content:encoded>
    </item>
    <item>
      <title>How to enable "click through" for .NET 2.0 ToolStrip and MenuStrip</title>
      <link>https://docs.microsoft.com/archive/blogs/rickbrew/how-to-enable-click-through-for-net-2-0-toolstrip-and-menustrip</link>
      <pubDate>Mon, 09 Jan 2006 18:00:00 GMT</pubDate>
      <dc:creator><![CDATA[rickbrew]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rickbrew/2006/01/09/how-to-enable-click-through-for-net-2-0-toolstrip-and-menustrip/</guid>
      <description><![CDATA[.NET 2.0's ToolStrip classes do not support "Click Through" between forms. For more information on...]]></description>
      <content:encoded><![CDATA[<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">.NET 2.0's ToolStrip classes do not support "Click Through" between forms. For more information on what click through is, I recommend reading <A href="http://daringfireball.net/2003/05/interface_details_itunes_vs_safari">http://daringfireball.net/2003/05/interface_details_itunes_vs_safari</A> . In Windows, pretty much all applications use "click through," whereby if you have one window active and click on to another one, the mouse click activates the window <SPAN style="FONT-STYLE: italic">and </SPAN>the click is processed by whatever control you had the mouse over.</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">However, you'll notice that Office 2003 and Visual Studio 2005 do not have this type of behavior for at least their menus and toolbars. If you have a window other than Word 2003 active, and hover your mouse over the Word toolbars, you will notice that they do not hot-track. Clicking will first activate the Word window after which you must click again on the toolbar item to activate it.</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">This is fine and good, and I don't disagree with this user interface decision. However, the .NET 2.0 ToolStrip class makes one glaring omission: it doesn't allow you to disable this behavior. Or rather, it does not allow you to enable click-through. This is usually not important for the most common use of the ToolStrip class, that being to create an application with toolbars docking to the edges of its only Form.</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">In Paint.NET we have 5 forms active. There's the main form (in code it is aptly called MainForm), then the four child or <SPAN style="FONT-STYLE: italic">owned </SPAN>forms that host the Tools, History, Layers, and Colors windows. In Paint.NET I have done a lot of work to ensure that they all behave for the user as one active window.</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">The problem for us is that the no-click-through behavior persists <SPAN style="FONT-STYLE: italic">even within the same application</SPAN>. That is, if the focus is currently on the image canvas in Paint.NET, the moment you try to click on another tool in the Tools window it will actually set focus to the Tools window and not set the tool until you click again. Oops. Actually this isn't really so much of a problem except that you can not configure whether this behavior is used or not.</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">Well I managed to fix that before we had a public release of v2.6, and I'd like to detail the code that's necessary to do this.</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">One thing I highly recommend for anyone doing non-trivial Windows Forms development is to get a copy of Reflector (<A href="http://www.aisto.com/roeder/dotnet/">http://www.aisto.com/roeder/dotnet/</A>) and the disassembly plugin by Denis Bauer (<A href="http://www.denisbauer.com/NETTools/FileDisassembler.aspx">http://www.denisbauer.com/NETTools/FileDisassembler.aspx</A>). Next, open up Reflector and add all of the core .NET assemblies. Then run the disassembler plugin over all of them. The code you get is not perfect -- some variable names are lost during compilation and end up being generic upon disassembly -- but the code flow and techniques are there and are very valuable to have. It's good to be able to answer questions such as, "When I set/get this property, is it copying just the reference or calling Clone()?" (hint: almost always the latter)</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">It took me awhile, but I found that the way this no-click-through is implemented is via the WM_MOUSEACTIVATE notification, and is handled in an overridden WndProc() method. It supports 4 return values which are a 2x2 matrix of "activate" and "eat mouse click." Turns out that the ToolStrip is returning the value corresponding to "activate and eat" (MA_ACTIVATEANDEAT) whereas we want "activate but do NOT eat" (MA_ACTIVATE).</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">Once we know this it is trivial to create a ToolStripEx class that implements this. This does require unmanaged code permission, and is something of a hack, so you should take that into consideration when using this code.</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;summary&gt;</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> This class adds on to the functionality provided in System.Windows.Forms.ToolStrip.</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;/summary&gt;</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: teal">ToolStripEx</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>: <SPAN style="COLOR: teal">ToolStrip</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2">{</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: blue"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private</SPAN> <SPAN style="COLOR: blue">bool</SPAN> clickThrough = <SPAN style="COLOR: blue">false</SPAN>;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;summary&gt;</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>///</SPAN><SPAN style="COLOR: green"> Gets or sets whether the ToolStripEx honors item clicks when its containing form does</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>///</SPAN><SPAN style="COLOR: green"> not have input focus.</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;/summary&gt;</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;remarks&gt;</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>///</SPAN><SPAN style="COLOR: green"> Default value is false, which is the same behavior provided by the base ToolStrip class.</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;/remarks&gt;</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">bool</SPAN> ClickThrough</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN>{</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: blue">get</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>{</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">this</SPAN>.clickThrough;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>}</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: blue">set</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>{</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: blue">this</SPAN>.clickThrough = <SPAN style="COLOR: blue">value</SPAN>;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>}</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN>}</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: blue">protected</SPAN> <SPAN style="COLOR: blue">override</SPAN> <SPAN style="COLOR: blue">void</SPAN> WndProc(<SPAN style="COLOR: blue">ref</SPAN> <SPAN style="COLOR: teal">Message</SPAN> m)</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN>{</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: blue">base</SPAN>.WndProc(<SPAN style="COLOR: blue">ref</SPAN> m);</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: blue">if</SPAN> (<SPAN style="COLOR: blue">this</SPAN>.clickThrough &amp;&amp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>m.Msg == <SPAN style="COLOR: teal">NativeConstants</SPAN>.WM_MOUSEACTIVATE &amp;&amp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>m.Result == (<SPAN style="COLOR: teal">IntPtr</SPAN>)<SPAN style="COLOR: teal">NativeConstants</SPAN>.MA_ACTIVATEANDEAT)</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>{</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>m.Result = (<SPAN style="COLOR: teal">IntPtr</SPAN>)<SPAN style="COLOR: teal">NativeConstants</SPAN>.MA_ACTIVATE;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN>}</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: gray"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN>}</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2">}</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="COLOR: blue">internal</SPAN> <SPAN style="COLOR: blue">sealed</SPAN> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: teal">NativeConstants</SPAN></P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2">{</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">private</SPAN> NativeConstants()</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana; mso-outline-level: 2">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">internal</SPAN> <SPAN style="COLOR: blue">const</SPAN> <SPAN style="COLOR: blue">uint</SPAN> WM_MOUSEACTIVATE = 0x21;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">internal</SPAN> <SPAN style="COLOR: blue">const</SPAN> <SPAN style="COLOR: blue">uint</SPAN> MA_ACTIVATE = 1;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">internal</SPAN> <SPAN style="COLOR: blue">const</SPAN> <SPAN style="COLOR: blue">uint</SPAN> MA_ACTIVATEANDEAT = 2;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">internal</SPAN> <SPAN style="COLOR: blue">const</SPAN> <SPAN style="COLOR: blue">uint</SPAN> MA_NOACTIVATE = 3;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">internal</SPAN> <SPAN style="COLOR: blue">const</SPAN> <SPAN style="COLOR: blue">uint</SPAN> MA_NOACTIVATEANDEAT = 4;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: 'Courier New'; mso-outline-level: 2">}</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">Then simply use ToolStripEx in place of ToolStrip.</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">The important thing with this hack is that you let the ToolStrip base class process the message first, and only fudge the <SPAN style="FONT-STYLE: italic">return value </SPAN>from the window message handling <SPAN style="FONT-STYLE: italic">if </SPAN>it is returning the one value you are worried about. Otherwise you're overstepping what you're trying to do (and things don't work right).</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">&nbsp;</P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1">Also, the MenuStrip class has the same behavior (no click through). It's easy enough to take this hack and make a "MenuStripEx" class. In Paint.NET v2.6, I put the common WndProc functionality into a utility function that both of these classes make use of (PaintDotNet.SystemLayer.UI.ClickThroughWndProc()).</P>]]></content:encoded>
    </item>
  </channel>
</rss>