<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Chris Tacke</title>
    <link>http://blog.opennetcf.com/ctacke/</link>
    <description>Bringing Managed Code to the Embedded World</description>
    <copyright>Chris Tacke</copyright>
    <lastBuildDate>Wed, 01 Jul 2009 20:06:15 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>ctacke@opennetcf.com</managingEditor>
    <webMaster>ctacke@opennetcf.com</webMaster>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=5afded23-76ae-489e-8876-7b7b33ee1bd5</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,5afded23-76ae-489e-8876-7b7b33ee1bd5.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,5afded23-76ae-489e-8876-7b7b33ee1bd5.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=5afded23-76ae-489e-8876-7b7b33ee1bd5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      It's now easier than ever to evaluate <a href="http://www.opennetcf.com/padarn.ocf">Padarn</a>,
      our ASP.NET Web Server for Windows CE.  We now have available an Evaluation Kit
      that comes with:
   </p>
        <ul>
          <li>
         A 600MHz fanless Windows CE 6.0 device</li>
          <li>
         13 hands-on labs with full source code</li>
          <li>
         A full sample Padarn web site with source code</li>
          <li>
         Fully-functional Padarn evaluation binaries</li>
        </ul>
        <p>
      The kit is being offered at an introductory price of $300.00, and if that isn't enough
      to convince you, we'll even credit that against any purchase of Padarn you make.
   </p>
        <p>
      For more information, <a href="http://www.opennetcf.com/padarn.ocf">see the Padarn
      web site</a>.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=5afded23-76ae-489e-8876-7b7b33ee1bd5" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>Padarn Evaluation Kits Now Available</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,5afded23-76ae-489e-8876-7b7b33ee1bd5.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/07/01/PadarnEvaluationKitsNowAvailable.aspx</link>
      <pubDate>Wed, 01 Jul 2009 20:06:15 GMT</pubDate>
      <description>&lt;p&gt;
   It's now easier than ever to evaluate &lt;a href="http://www.opennetcf.com/padarn.ocf"&gt;Padarn&lt;/a&gt;,
   our ASP.NET Web Server for Windows CE.&amp;nbsp; We now have available an Evaluation Kit
   that comes with:
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      A 600MHz fanless Windows CE 6.0 device&lt;/li&gt;
   &lt;li&gt;
      13 hands-on labs with full source code&lt;/li&gt;
   &lt;li&gt;
      A full sample Padarn web site with source code&lt;/li&gt;
   &lt;li&gt;
      Fully-functional Padarn evaluation binaries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
   The kit is being offered at an introductory price of $300.00, and if that isn't enough
   to convince you, we'll even credit that against any purchase of Padarn you make.
&lt;/p&gt;
&lt;p&gt;
   For more information, &lt;a href="http://www.opennetcf.com/padarn.ocf"&gt;see the Padarn
   web site&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=5afded23-76ae-489e-8876-7b7b33ee1bd5" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,5afded23-76ae-489e-8876-7b7b33ee1bd5.aspx</comments>
      <category>OpenNETCF;Padarn</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=afa181fc-622f-4d34-9a69-544de369c954</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,afa181fc-622f-4d34-9a69-544de369c954.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,afa181fc-622f-4d34-9a69-544de369c954.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=afa181fc-622f-4d34-9a69-544de369c954</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      The latest version of our <a href="http://opennetcf.com/padarn.ocf">Padarn Mobile
      Server</a> supports VirtualPathProviders.  This means that now it is easy
      to create <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST
      Web Services</a> that run on your Windows CE or Windows Mobile device.  Download
      the latest hands-on lab "<strong><u>HOL P303 - Using VirtualPathProviders in Padarn
      to provide REST Web Services</u></strong>" <a href="http://opennetcf.com/Products/Padarn/Downloads/tabid/276/Default.aspx">from
      the web site here</a>.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=afa181fc-622f-4d34-9a69-544de369c954" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>Padarn now supports VirtualPathProviders</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,afa181fc-622f-4d34-9a69-544de369c954.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/29/PadarnNowSupportsVirtualPathProviders.aspx</link>
      <pubDate>Mon, 29 Jun 2009 17:31:39 GMT</pubDate>
      <description>&lt;p&gt;
   The latest version of our &lt;a href="http://opennetcf.com/padarn.ocf"&gt;Padarn Mobile
   Server&lt;/a&gt;&amp;nbsp;supports VirtualPathProviders.&amp;nbsp; This means that now it is easy
   to create &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"&gt;REST
   Web Services&lt;/a&gt; that run on your Windows CE or Windows Mobile device.&amp;nbsp; Download
   the latest hands-on lab "&lt;strong&gt;&lt;u&gt;HOL P303 - Using VirtualPathProviders in Padarn
   to provide REST Web Services&lt;/u&gt;&lt;/strong&gt;" &lt;a href="http://opennetcf.com/Products/Padarn/Downloads/tabid/276/Default.aspx"&gt;from
   the web site here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=afa181fc-622f-4d34-9a69-544de369c954" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,afa181fc-622f-4d34-9a69-544de369c954.aspx</comments>
      <category>OpenNETCF;Padarn</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=364731df-b779-4518-95b4-45bf9c1f7dc7</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,364731df-b779-4518-95b4-45bf9c1f7dc7.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,364731df-b779-4518-95b4-45bf9c1f7dc7.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=364731df-b779-4518-95b4-45bf9c1f7dc7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      As you may have guessed from some of my recent blog entries, we're making a push to
      get a lot of our shared source code out to the Codeplex servers.  Our serial
      library is the latest one to make the move.  It's now available at <a href="http://serial.codeplex.com">http://serial.codeplex.com</a>. 
      As with all of these libraries, if you have the desire to contribute, fix, extend,
      or whatever just let us know and we'll add you as a developer.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=364731df-b779-4518-95b4-45bf9c1f7dc7" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>OpenNETCF.IO.Serial Library moved to Codeplex</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,364731df-b779-4518-95b4-45bf9c1f7dc7.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/26/OpenNETCFIOSerialLibraryMovedToCodeplex.aspx</link>
      <pubDate>Fri, 26 Jun 2009 14:24:33 GMT</pubDate>
      <description>&lt;p&gt;
   As you may have guessed from some of my recent blog entries, we're making a push to
   get a lot of our shared source code out to the Codeplex servers.&amp;nbsp; Our serial
   library is the latest one to make the move.&amp;nbsp; It's now available at &lt;a href="http://serial.codeplex.com"&gt;http://serial.codeplex.com&lt;/a&gt;.&amp;nbsp;
   As with all of these libraries, if you have the desire to contribute, fix, extend,
   or whatever just let us know and we'll add you as a developer.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=364731df-b779-4518-95b4-45bf9c1f7dc7" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,364731df-b779-4518-95b4-45bf9c1f7dc7.aspx</comments>
      <category>.NET Compact Framework;Community;Desktop Development;OpenNETCF</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=8f35165e-f4c9-4042-bf33-c02c6a555d0f</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,8f35165e-f4c9-4042-bf33-c02c6a555d0f.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,8f35165e-f4c9-4042-bf33-c02c6a555d0f.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=8f35165e-f4c9-4042-bf33-c02c6a555d0f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      In an effort to clean up our servers, to make code easier to find, and to hopefully
      make it easier for the community at-large to contribute, we've moved our popular Desktop
      Communication library over to the Codeplex servers.
   </p>
        <p>
      Visit the project at <a href="http://rapi.codeplex.com">rapi.codeplex.com</a>.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=8f35165e-f4c9-4042-bf33-c02c6a555d0f" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>OpenNETCF.Desktop.Communication library has moved to Codeplex</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,8f35165e-f4c9-4042-bf33-c02c6a555d0f.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/25/OpenNETCFDesktopCommunicationLibraryHasMovedToCodeplex.aspx</link>
      <pubDate>Thu, 25 Jun 2009 23:38:36 GMT</pubDate>
      <description>&lt;p&gt;
   In an effort to clean up our servers, to make code easier to find, and to hopefully
   make it easier for the community at-large to contribute, we've moved our popular Desktop
   Communication library over to the Codeplex servers.
&lt;/p&gt;
&lt;p&gt;
   Visit the project at &lt;a href="http://rapi.codeplex.com"&gt;rapi.codeplex.com&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=8f35165e-f4c9-4042-bf33-c02c6a555d0f" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,8f35165e-f4c9-4042-bf33-c02c6a555d0f.aspx</comments>
      <category>Community;Desktop Development;OpenNETCF</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=afbbd8b7-1a77-4331-90e0-ba53a43c179a</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,afbbd8b7-1a77-4331-90e0-ba53a43c179a.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,afbbd8b7-1a77-4331-90e0-ba53a43c179a.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=afbbd8b7-1a77-4331-90e0-ba53a43c179a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Over the past few months we've been working hard to consolidate the products we at
      OpenNETCF offer.  What this means is that products that didn't sell well or that
      had high support loads compared to sales got dropped.  Our Telephony library
      is one of those that we decided to discontinue.  But that's good news for all! 
      Instead of just letting it wither and die in the depths of our own source control
      server, we figure it might as well be thrown out to the community to see if it will
      flourish.
   </p>
        <p>
      SO with that, we give you the OpenNETCF.Telephony Library, <a href="http://tapi.codeplex.com">hosted
      over at Codeplex as tapi.codeplex.com</a>.  Enjoy.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=afbbd8b7-1a77-4331-90e0-ba53a43c179a" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>OpenNETCF.Telephony library (TAPI) released under shared-source license</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,afbbd8b7-1a77-4331-90e0-ba53a43c179a.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/25/OpenNETCFTelephonyLibraryTAPIReleasedUnderSharedsourceLicense.aspx</link>
      <pubDate>Thu, 25 Jun 2009 23:06:39 GMT</pubDate>
      <description>&lt;p&gt;
   Over the past few months we've been working hard to consolidate the products we at
   OpenNETCF offer.&amp;nbsp; What this means is that products that didn't sell well or that
   had high support loads compared to sales got dropped.&amp;nbsp; Our Telephony library
   is one of those that we decided to discontinue.&amp;nbsp; But that's good news for all!&amp;nbsp;
   Instead of just letting it wither and die in the depths of our own source control
   server, we figure it might as well be thrown out to the community to see if it will
   flourish.
&lt;/p&gt;
&lt;p&gt;
   SO with that, we give you the OpenNETCF.Telephony Library, &lt;a href="http://tapi.codeplex.com"&gt;hosted
   over at Codeplex as tapi.codeplex.com&lt;/a&gt;.&amp;nbsp; Enjoy.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=afbbd8b7-1a77-4331-90e0-ba53a43c179a" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,afbbd8b7-1a77-4331-90e0-ba53a43c179a.aspx</comments>
      <category>Community;Compact Framework Code;OpenNETCF</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=147bb6f8-b6a9-4eb7-9b43-2a9ecb1aab67</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,147bb6f8-b6a9-4eb7-9b43-2a9ecb1aab67.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,147bb6f8-b6a9-4eb7-9b43-2a9ecb1aab67.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=147bb6f8-b6a9-4eb7-9b43-2a9ecb1aab67</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      In my <a href="http://blog.opennetcf.com/ctacke/2009/06/25/GettingClickEventsForAListViewInTheCompactFramework.aspx">last
      blog entry</a>, I showed a workaround for getting mouse events for the CF ListView. 
      Since I can't leave well enough alone, I decided I'd actually try implementing the
      HitTest method (now that we have a valid x,y click coordinate).  Here's the result:
   </p>
        <p>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">namespace</span> OpenNETCF.Windows.Forms<br />
      {<br />
        [Flags]<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">  </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">enum</span> ListViewHitTestLocations<br />
        {<br />
          None <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0x01,<br />
          Image <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0x02,<br />
          Label <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0x04,<br />
          StateImage <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0x08,<br /><br />
          AboveClientArea <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0x08,<br />
          BelowClientArea <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0x10,<br />
          RightOfClientArea <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0x20,<br />
          LeftOfClientArea <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0x40,<br />
        }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">  </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">class</span> ListViewHitTestInfo<br />
        {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span> ListViewItem
      Item { get; set; }<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span> ListViewHitTestLocations
      Location { get; set; }<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span> ListViewItem.ListViewSubItem
      SubItem { get; set; }<br />
        }<br />
      }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">namespace</span> OpenNETCF.Core<br />
      {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">  </font>using</span> OpenNETCF.Windows.Forms;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">  </font>using</span> System.Runtime.InteropServices;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">  </font>using</span> System.Diagnostics;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">  </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">static</span> partial <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">class</span> Extensions<br />
        {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>private</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">const</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> LVM_FIRST <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0x1000;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>private</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">const</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> LVM_GETCOUNTPERPAGE <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> LVM_FIRST <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> 40;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>private</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">const</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> LVM_SUBITEMHITTEST <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> LVM_FIRST <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> 57;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>private</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">struct</span> LVHITTESTINFO<br />
          {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> x;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> y;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>public</span> ListViewHitTestLocations
      flags;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> iItem;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> iSubItem;<br />
          }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">static</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> GetVisibleRowCount(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span> ListView
      lv)<br />
          {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>return</span> Win32Window.SendMessage(lv.Handle,
      LVM_GETCOUNTPERPAGE, 0, 0).ToInt32();<br />
          }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">static</span> ListViewHitTestInfo
      HitTest(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span> ListView
      lv, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> x, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> y)<br />
          {<br />
            LVHITTESTINFO info <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> LVHITTESTINFO();<br />
            info.x <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> x;<br />
            info.y <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> y;<br />
            GCHandle pInfo <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> GCHandle.Alloc(info,
      GCHandleType.Pinned);<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>try</span><br />
            {<br />
              Win32Window.SendMessage(lv.Handle, LVM_SUBITEMHITTEST,
      0, pInfo.AddrOfPinnedObject());<br />
              LVHITTESTINFO result <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> (LVHITTESTINFO)pInfo.Target;<br />
              ListViewHitTestInfo lvhti <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> ListViewHitTestInfo();<br /><br />
              lvhti.Location <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> result.flags;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">        </font>switch</span> (lvhti.Location)<br />
              {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">          </font>case</span> ListViewHitTestLocations.Image:<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">          </font>case</span> ListViewHitTestLocations.Label:<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">          </font>case</span> ListViewHitTestLocations.StateImage:<br />
                  lvhti.Item <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> lv.Items[result.iItem];<br />
                  lvhti.SubItem <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> lvhti.Item.SubItems[result.iSubItem];<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">            </font>break</span>;<br />
              }<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">        </font>return</span> lvhti;<br />
            }<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>finally</span><br />
            {<br />
              pInfo.Free();<br />
            }<br />
          }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">   
      public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">static</span> ListViewHitTestInfo
      HitTest(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span> ListView
      lv, Point point)<br />
          {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">     
      return</span> lv.HitTest(point.X, point.Y);<br />
          }<br />
        }<br />
      }<br /></span>
        </p>
        <p>
      And usage looks like this:
   </p>
        <p>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">public</span> partial <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">class</span> Foo
      : Form<br />
      {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"> 
      public</span> Foo()<br />
        {<br />
          InitializeComponent();<br />
          listView.Items.Add(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> ListViewItem(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">string</span>[]
      { <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Item
      A"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      A1"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      A2"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      A3"</span> }));<br />
          listView.Items.Add(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> ListViewItem(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">string</span>[]
      { <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Item
      B"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      B1"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      B2"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      B3"</span> }));<br />
          listView.Items.Add(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> ListViewItem(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">string</span>[]
      { <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Item
      C"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      C1"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      C2"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      C3"</span> }));<br />
          listView.Items.Add(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> ListViewItem(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">string</span>[]
      { <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Item
      D"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      D1"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      D2"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      D3"</span> }));<br />
          listView.Items.Add(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> ListViewItem(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">string</span>[]
      { <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Item
      E"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      E1"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      E2"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Sub
      E3"</span> }));<br /><br />
          ClickFilter filter <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> ClickFilter(listView);<br />
          Application2.AddMessageFilter(filter);<br />
          filter.MouseDown += <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> MouseEventHandler(filter_MouseDown);<br /><br />
        }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"> 
      void</span> filter_MouseDown(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">object</span> sender,
      MouseEventArgs e)<br />
        {<br />
          ListView lv <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> sender <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">as</span> ListView;<br />
          ListViewHitTestInfo hti <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> lv.HitTest(e.X,
      e.Y);<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>if</span> (hti.Item
      !<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">null</span>)<br />
          {<br />
            Debug.WriteLine(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">string</span>.Format(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Item:
      {0}, SubItem: {1}"</span>, hti.Item.Text, hti.SubItem.Text));<br />
          }<br />
        }<br />
      }<br /></span>
        </p>
        <p>
      All of this will end up in SDF v. Next, but why do we have to implement fundamental
      things like this that should already be there?  It was excusable to be missing
      in v 1.0.  Maybe even in v 2.0, but in 3.5?  Really?
   </p>
        <p>
       
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=147bb6f8-b6a9-4eb7-9b43-2a9ecb1aab67" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>ListView HitTest implementation</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,147bb6f8-b6a9-4eb7-9b43-2a9ecb1aab67.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/25/ListViewHitTestImplementation.aspx</link>
      <pubDate>Thu, 25 Jun 2009 16:38:57 GMT</pubDate>
      <description>&lt;p&gt;
   In my &lt;a href="http://blog.opennetcf.com/ctacke/2009/06/25/GettingClickEventsForAListViewInTheCompactFramework.aspx"&gt;last
   blog entry&lt;/a&gt;, I showed a workaround for getting mouse events for the CF ListView.&amp;nbsp;
   Since I can't leave well enough alone, I decided I'd actually try implementing the
   HitTest method (now that we have a valid x,y click coordinate).&amp;nbsp; Here's the result:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;namespace&lt;/span&gt; OpenNETCF.Windows.Forms&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp; [Flags]&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;enum&lt;/span&gt; ListViewHitTestLocations&lt;br&gt;
   &amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; None &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0x01,&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; Image &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0x02,&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; Label &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0x04,&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; StateImage &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0x08,&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; AboveClientArea &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0x08,&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; BelowClientArea &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0x10,&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; RightOfClientArea &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0x20,&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; LeftOfClientArea &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0x40,&lt;br&gt;
   &amp;nbsp; }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;class&lt;/span&gt; ListViewHitTestInfo&lt;br&gt;
   &amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; ListViewItem
   Item { get; set; }&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; ListViewHitTestLocations
   Location { get; set; }&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; ListViewItem.ListViewSubItem
   SubItem { get; set; }&lt;br&gt;
   &amp;nbsp; }&lt;br&gt;
   }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;namespace&lt;/span&gt; OpenNETCF.Core&lt;br&gt;
   {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp; &lt;/font&gt;using&lt;/span&gt; OpenNETCF.Windows.Forms;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp; &lt;/font&gt;using&lt;/span&gt; System.Runtime.InteropServices;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp; &lt;/font&gt;using&lt;/span&gt; System.Diagnostics;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;static&lt;/span&gt; partial &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;class&lt;/span&gt; Extensions&lt;br&gt;
   &amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;private&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;const&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; LVM_FIRST &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0x1000;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;private&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;const&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; LVM_GETCOUNTPERPAGE &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; LVM_FIRST &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;+&lt;/span&gt; 40;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;private&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;const&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; LVM_SUBITEMHITTEST &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; LVM_FIRST &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;+&lt;/span&gt; 57;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;private&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;struct&lt;/span&gt; LVHITTESTINFO&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; x;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; y;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; ListViewHitTestLocations
   flags;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; iItem;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; iSubItem;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;static&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; GetVisibleRowCount(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt; ListView
   lv)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;return&lt;/span&gt; Win32Window.SendMessage(lv.Handle,
   LVM_GETCOUNTPERPAGE, 0, 0).ToInt32();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;static&lt;/span&gt; ListViewHitTestInfo
   HitTest(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt; ListView
   lv, &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; x, &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; y)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LVHITTESTINFO info &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; LVHITTESTINFO();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; info.x &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; x;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; info.y &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; y;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GCHandle pInfo &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; GCHandle.Alloc(info,
   GCHandleType.Pinned);&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;try&lt;/span&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Win32Window.SendMessage(lv.Handle, LVM_SUBITEMHITTEST,
   0, pInfo.AddrOfPinnedObject());&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LVHITTESTINFO result &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; (LVHITTESTINFO)pInfo.Target;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ListViewHitTestInfo lvhti &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; ListViewHitTestInfo();&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lvhti.Location &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; result.flags;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;switch&lt;/span&gt; (lvhti.Location)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;case&lt;/span&gt; ListViewHitTestLocations.Image:&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;case&lt;/span&gt; ListViewHitTestLocations.Label:&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;case&lt;/span&gt; ListViewHitTestLocations.StateImage:&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lvhti.Item &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; lv.Items[result.iItem];&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lvhti.SubItem &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; lvhti.Item.SubItems[result.iSubItem];&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;break&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;return&lt;/span&gt; lvhti;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;finally&lt;/span&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pInfo.Free();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
   public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;static&lt;/span&gt; ListViewHitTestInfo
   HitTest(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt; ListView
   lv, Point point)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
   return&lt;/span&gt; lv.HitTest(point.X, point.Y);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &amp;nbsp; }&lt;br&gt;
   }&lt;br&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   And usage looks like this:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;public&lt;/span&gt; partial &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;class&lt;/span&gt; Foo
   : Form&lt;br&gt;
   {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;
   public&lt;/span&gt; Foo()&lt;br&gt;
   &amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; listView.Items.Add(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; ListViewItem(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;string&lt;/span&gt;[]
   { &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Item
   A"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   A1"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   A2"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   A3"&lt;/span&gt; }));&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; listView.Items.Add(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; ListViewItem(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;string&lt;/span&gt;[]
   { &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Item
   B"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   B1"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   B2"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   B3"&lt;/span&gt; }));&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; listView.Items.Add(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; ListViewItem(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;string&lt;/span&gt;[]
   { &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Item
   C"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   C1"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   C2"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   C3"&lt;/span&gt; }));&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; listView.Items.Add(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; ListViewItem(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;string&lt;/span&gt;[]
   { &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Item
   D"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   D1"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   D2"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   D3"&lt;/span&gt; }));&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; listView.Items.Add(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; ListViewItem(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;string&lt;/span&gt;[]
   { &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Item
   E"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   E1"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   E2"&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Sub
   E3"&lt;/span&gt; }));&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; ClickFilter filter &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; ClickFilter(listView);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; Application2.AddMessageFilter(filter);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; filter.MouseDown += &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; MouseEventHandler(filter_MouseDown);&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp; }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;
   void&lt;/span&gt; filter_MouseDown(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;object&lt;/span&gt; sender,
   MouseEventArgs e)&lt;br&gt;
   &amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; ListView lv &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; sender &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;as&lt;/span&gt; ListView;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; ListViewHitTestInfo hti &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; lv.HitTest(e.X,
   e.Y);&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;if&lt;/span&gt; (hti.Item
   !&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;null&lt;/span&gt;)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;string&lt;/span&gt;.Format(&lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Item:
   {0}, SubItem: {1}"&lt;/span&gt;, hti.Item.Text, hti.SubItem.Text));&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &amp;nbsp; }&lt;br&gt;
   }&lt;br&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   All of this will end up in SDF v. Next, but why do we have to implement fundamental
   things like this that should already be there?&amp;nbsp; It was excusable to be missing
   in v 1.0.&amp;nbsp; Maybe even in v 2.0, but in 3.5?&amp;nbsp; Really?
&lt;/p&gt;
&lt;p&gt;
   &amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=147bb6f8-b6a9-4eb7-9b43-2a9ecb1aab67" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,147bb6f8-b6a9-4eb7-9b43-2a9ecb1aab67.aspx</comments>
      <category>.NET Compact Framework;OpenNETCF;SDF Samples</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=63666702-6b6e-4cb5-8f1b-e2fc688e3a7e</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,63666702-6b6e-4cb5-8f1b-e2fc688e3a7e.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,63666702-6b6e-4cb5-8f1b-e2fc688e3a7e.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=63666702-6b6e-4cb5-8f1b-e2fc688e3a7e</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      We're going to be adding a full set of custom-drawn and owner-drawn controls in the
      next version of the SDF.  These are not "new" controls, but wrappers around the
      existing native control, but we're adding the custom and owner draw hooks that the
      OS already provides (and that, honestly, the CF team should have given us by version
      3.5).  
   </p>
        <p>
      In testing them out, I wanted to dogfood the custom-drawn ListView in an application,
      but I needed to know when a user clicked on an item in the ListView.  Simple. 
      Or so I thought.  It turns out that the style bits that get set to make a ListView
      really usable means that the ListView's *parent* gets it's click actions, and to turn
      those into Click events in the managed control is a *lot* of work, and would likely
      have some performance penalty.
   </p>
        <p>
      So that got me to wondering how the existing CF ListView deals with it.  Well
      after a very quick test it seems that the CF team made the same decision - <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview_events.aspx">they
      didn't support the Click event either</a>.  
   </p>
        <p>
      Well my application requires that I know the difference between when the selected
      index changes (that's about the only useful event you do get) due a click and and
      when it changes dues to a keyboard action like an up or down arrow. Being me, I refuse
      to change the way I want my application will work just becasue of some stupid limitation
      of a framework.  The OS knows when I click on that damned thing - after all,
      it changes the selected item - so it *will* tell my application when it happens.
   </p>
        <p>
      The key here is pretty simple.  We know that the click event does come in, and
      it comes in as a Windows message.  Our application message pump routes it to
      the parent of the ListView - so we have two point at which we can try to get it. 
      Getting it from the parent would entail subclassing the parent Form, and that just
      does seem like fun, nor is it really extensible if I ever have another app where I
      want to get ListView item clicks.
   </p>
        <p>
      So that leaves looking at the application message pump.  Unfortunately the CF
      team has again not seen fit in any version to provide us the ability to add an IMessageFilter,
      but this was something we overcame long ago in <a href="http://www.opennetcf.com/Products/SmartDeviceFramework/tabid/65/Default.aspx">the
      SDF</a>.  If you use the Application2.Run method, you can then add IMessageFilters. 
      So what I did here is created an IMessageFilter that looks for messages
      whose hWnd matches the ListView I'm interested in, and then looks for the WM_LBUTTONDOWN
      message:
   </p>
        <p>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">internal</span>
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">class</span> ClickFilter
      : IMessageFilter<br />
      {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"> 
      private</span> Control m_control;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">event</span> EventHandler
      Click;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">event</span> MouseEventHandler
      MouseDown;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>public</span> ClickFilter(Control
      control)<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>{<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>m_control <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> control;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>}<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>private</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> LoWord(IntPtr
      param)<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>{<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>return</span> (<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ushort</span>)(param.ToInt32()
      &amp; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ushort</span>.MaxValue);<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>}<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>private</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> HiWord(IntPtr
      param)<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>{<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>return</span> (<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ushort</span>)(param.ToInt32()
      &gt;&gt; 16);<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>}<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">bool</span> PreFilterMessage(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ref</span> Microsoft.WindowsCE.Forms.Message
      m)<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>{<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>if</span> (m_control.IsDisposed) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">false</span>;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>if</span> ((m.HWnd
      == m_control.Handle) &amp;&amp; (m.Msg == (<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span>)Microsoft.Controls.WM.WM_LMOUSEDOWN))<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>{<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span></span>MouseEventArgs
      args <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> MouseEventArgs(MouseButtons.Left,
      1, LoWord(m.LParam), HiWord(m.LParam), 0);<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span></span>ThreadPool.QueueUserWorkItem(ButtonInvoker,
      args);<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>}<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>return</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">false</span>;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>}<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>void</span> ButtonInvoker(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">object</span> o)<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>{<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>// let
      the system select the clicked listview item</span><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>Thread.Sleep(10);<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>Application2.DoEvents();<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>if</span> (m_control.IsDisposed) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span>;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>if</span> (m_control.InvokeRequired)<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>{<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span></span>m_control.Invoke(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> WaitCallback(ButtonInvoker), <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">object</span>[]
      { o });<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span></span>return</span>;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>}<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>//
      not truly a click, since it's not a down/up pair. Fix this later if we feel like it</span><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>if</span>(Click
      !<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">null</span>)
      Click(m_control, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">null</span>);<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span></span>if</span> (MouseDown
      !<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">null</span>)
      MouseDown(m_control, o <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">as</span> MouseEventArgs);<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">  </span>}<br />
      }</span>
        </p>
        <p>
      Take note of the slight kludge in there though with the ThreadPool.  The reason
      for this is that if you just raise the event immediately on getting the mouse down
      event, the ListViewItem selection won't have happened yet, so if your handler looks
      at the SelectedItem, it would get the item that was selected before the click, not
      the one that the was clicked.  
   </p>
        <p>
      Sure, maybe that's what your app wants, but in my case I wanted to know which item
      is actually clicked.  The ListView doesn't support a HitTest method (again, why
      don't we have this yet?), so knowing the x,y coordinates of the click is still a long
      way from giving us the ListViewItem.  This was a kludge to easily get me the
      info I wanted.
   </p>
        <p>
      So using this filter in my application was as easy as adding this to the
      Form that contains the ListView:
   </p>
        <p>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">InitializeComponent();<br /><br />
      ClickFilter filter <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> ClickFilter(listView);<br />
      filter.Click += <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> EventHandler(filter_Click);<br />
      Application2.AddMessageFilter(filter);<br /></span>
        </p>
        <p>
      No, it shouldn't be this hard.  I wish the CF team would spend more time fixing
      fundamental stuff like this instead of tilting at the Silverlight windmill, but it
      is what it is, and as developers we still have to ship solutions.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=63666702-6b6e-4cb5-8f1b-e2fc688e3a7e" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>Getting click events for a ListView in the Compact Framework.</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,63666702-6b6e-4cb5-8f1b-e2fc688e3a7e.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/25/GettingClickEventsForAListViewInTheCompactFramework.aspx</link>
      <pubDate>Thu, 25 Jun 2009 15:27:26 GMT</pubDate>
      <description>&lt;p&gt;
   We're going to be adding a full set of custom-drawn and owner-drawn controls in the
   next version of the SDF.&amp;nbsp; These are not "new" controls, but wrappers around the
   existing native control, but we're adding the custom and owner draw hooks that the
   OS already provides (and that, honestly, the CF team should have given us by version
   3.5).&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
   In testing them out, I wanted to dogfood the custom-drawn ListView in an application,
   but I needed to know when a user clicked on an item in the ListView.&amp;nbsp; Simple.&amp;nbsp;
   Or so I thought.&amp;nbsp; It turns out that the style bits that get set to make a ListView
   really usable means that the ListView's *parent* gets it's click actions, and to turn
   those into Click events in the managed control is a *lot* of work, and would likely
   have some performance penalty.
&lt;/p&gt;
&lt;p&gt;
   So that got me to wondering how the existing CF ListView deals with it.&amp;nbsp; Well
   after a very quick test it seems that the CF team made the same decision - &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview_events.aspx"&gt;they
   didn't support the Click event either&lt;/a&gt;.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
   Well my application requires that I know the difference between when the selected
   index changes (that's about the only useful event you do get) due a click and and
   when it changes dues to a keyboard action like an up or down arrow. Being me, I refuse
   to change the way I want my application will work just becasue of some stupid limitation
   of a framework.&amp;nbsp; The OS knows when I click on that damned thing - after all,
   it changes the selected item - so it *will* tell my application when it happens.
&lt;/p&gt;
&lt;p&gt;
   The key here is pretty simple.&amp;nbsp; We know that the click event does come in, and
   it comes in as a Windows message.&amp;nbsp; Our application message pump routes it to
   the parent of the ListView - so we have two point at which we can try to get it.&amp;nbsp;
   Getting it from the parent would entail subclassing the parent Form, and that just
   does seem like fun, nor is it really extensible if I ever have another app where I
   want to get ListView item clicks.
&lt;/p&gt;
&lt;p&gt;
   So that leaves looking at the application message pump.&amp;nbsp; Unfortunately the CF
   team has again not seen fit in any version to provide us the ability to add an IMessageFilter,
   but this was something we overcame long ago in &lt;a href="http://www.opennetcf.com/Products/SmartDeviceFramework/tabid/65/Default.aspx"&gt;the
   SDF&lt;/a&gt;.&amp;nbsp; If you use the Application2.Run method, you can then add IMessageFilters.&amp;nbsp;
   So what&amp;nbsp;I did&amp;nbsp;here is created an IMessageFilter that looks for messages
   whose hWnd matches the ListView I'm interested in, and then looks for the WM_LBUTTONDOWN
   message:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;internal&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;class&lt;/span&gt; ClickFilter
   : IMessageFilter&lt;br&gt;
   {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;
   private&lt;/span&gt; Control m_control;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;event&lt;/span&gt; EventHandler
   Click;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;event&lt;/span&gt; MouseEventHandler
   MouseDown;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;public&lt;/span&gt; ClickFilter(Control
   control)&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;{&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;m_control &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; control;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;}&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;private&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; LoWord(IntPtr
   param)&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;{&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;return&lt;/span&gt; (&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;ushort&lt;/span&gt;)(param.ToInt32()
   &amp;amp; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;ushort&lt;/span&gt;.MaxValue);&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;}&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;private&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; HiWord(IntPtr
   param)&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;{&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;return&lt;/span&gt; (&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;ushort&lt;/span&gt;)(param.ToInt32()
   &amp;gt;&amp;gt; 16);&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;}&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;bool&lt;/span&gt; PreFilterMessage(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;ref&lt;/span&gt; Microsoft.WindowsCE.Forms.Message
   m)&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;{&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if&lt;/span&gt; (m_control.IsDisposed) &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;false&lt;/span&gt;;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if&lt;/span&gt; ((m.HWnd
   == m_control.Handle) &amp;amp;&amp;amp; (m.Msg == (&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt;)Microsoft.Controls.WM.WM_LMOUSEDOWN))&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;{&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;MouseEventArgs
   args &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; MouseEventArgs(MouseButtons.Left,
   1, LoWord(m.LParam), HiWord(m.LParam), 0);&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;ThreadPool.QueueUserWorkItem(ButtonInvoker,
   args);&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;}&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;return&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;false&lt;/span&gt;;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;}&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;void&lt;/span&gt; ButtonInvoker(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;object&lt;/span&gt; o)&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;{&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;//&amp;nbsp;let
   the system select&amp;nbsp;the clicked listview item&lt;/span&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Thread.Sleep(10);&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Application2.DoEvents();&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if&lt;/span&gt; (m_control.IsDisposed) &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt;;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if&lt;/span&gt; (m_control.InvokeRequired)&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;{&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;m_control.Invoke(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; WaitCallback(ButtonInvoker), &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;object&lt;/span&gt;[]
   { o });&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;return&lt;/span&gt;;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;}&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;//
   not truly a click, since it's not a down/up pair. Fix this later if we feel like it&lt;/span&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if&lt;/span&gt;(Click
   !&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;null&lt;/span&gt;)
   Click(m_control, &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;null&lt;/span&gt;);&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if&lt;/span&gt; (MouseDown
   !&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;null&lt;/span&gt;)
   MouseDown(m_control, o &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;as&lt;/span&gt; MouseEventArgs);&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp; &lt;/span&gt;}&lt;br&gt;
   }&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   Take note of the slight kludge in there though with the ThreadPool.&amp;nbsp; The reason
   for this is that if you just raise the event immediately on getting the mouse down
   event, the ListViewItem selection won't have happened yet, so if your handler looks
   at the SelectedItem, it would get the item that was selected before the click, not
   the one that the was clicked.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
   Sure, maybe that's what your app wants, but in my case I wanted to know which item
   is actually clicked.&amp;nbsp; The ListView doesn't support a HitTest method (again, why
   don't we have this yet?), so knowing the x,y coordinates of the click is still a long
   way from giving us the ListViewItem.&amp;nbsp; This was a kludge to easily get me the
   info I wanted.
&lt;/p&gt;
&lt;p&gt;
   So using this filter in&amp;nbsp;my application was as easy as adding this to&amp;nbsp;the
   Form that contains the ListView:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;InitializeComponent();&lt;br&gt;
   &lt;br&gt;
   ClickFilter filter &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; ClickFilter(listView);&lt;br&gt;
   filter.Click += &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; EventHandler(filter_Click);&lt;br&gt;
   Application2.AddMessageFilter(filter);&lt;br&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   No, it shouldn't be this hard.&amp;nbsp; I wish the CF team would spend more time fixing
   fundamental stuff like this instead of tilting at the Silverlight windmill, but it
   is what it is, and as developers we still have to ship solutions.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=63666702-6b6e-4cb5-8f1b-e2fc688e3a7e" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,63666702-6b6e-4cb5-8f1b-e2fc688e3a7e.aspx</comments>
      <category>Compact Framework Code;OpenNETCF;SDF Samples</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=0a1aa3de-52b4-4b7e-a9d2-e958ef292434</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,0a1aa3de-52b4-4b7e-a9d2-e958ef292434.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,0a1aa3de-52b4-4b7e-a9d2-e958ef292434.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=0a1aa3de-52b4-4b7e-a9d2-e958ef292434</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      It took a long time to get here, but we've finally release what I'm calling the version
      1.0 (pervious version were 0.9.x) release of the <a href="http://ioc.codeplex.com">OpenNETCF.IoC
      Framework</a>.  In case you've not been tracking this project, it is a public-domain-licensed
      (you can't get any more free and unencumbered than that) framework that provides both <a href="http://en.wikipedia.org/wiki/Inversion_of_control">inversion
      of control</a> and <a href="http://martinfowler.com/articles/injection.html">dependency
      injection</a> for <a href="http://msdn.microsoft.com/en-us/netframework/aa497273.aspx">.NET
      Compact Framework</a> applications (it can be used on the desktop as well). 
      It's roughly modelled after <a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx">Microsoft's
      SCSF</a> and CAB frameworks, but it's scaled down and optimized for running on mobile
      and embedded devices, plus I "fixed" stuff that I think the SCSF got wrong (like having
      a static, globally available <a href="http://richnewman.wordpress.com/2007/09/09/creating-and-using-services-in-the-cab-introduction-to-the-cabscsf-part-8/">RootWorkItem</a> and
      the ability to insert <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.imessagefilter.aspx">IMessageFilters</a> into
      the application's message pump).
   </p>
        <p>
      This framework is in use in a couple of commercial applications already, so it's been
      pretty heavily tested and vetted.  I still want to add a few more features as
      well and go back through it looking for performance optimizations, but it certainly
      has enough features to be used in applications today.
   </p>
        <p>
      This release also ships with a full-blown, real-world sample application, not just
      the typical "Northwind" type of application.  The sample is called WiFiSurvey
      and it can be used to survey WiFi AP coverage of a site and to monitor associated
      AP changes as well as network addressability of a device.
   </p>
        <p>
      WiFiSurvey has a Configuration service, a <a href="http://www.microsoft.com/Sqlserver/2008/en/us/compact.aspx">SQL
      CE 3.5</a>-backed <a href="http://en.wikipedia.org/wiki/Data_access_layer">Data Access
      Layer</a>, an Infrastructure module and a an application shell all of which are fully
      decoupled from one another and that are all loaded dynamically using an XML definition
      file.  The shell makes use of both a DeckWorkspace and a TabWorkspace, showing
      you not just how to use them, but also how to create your own workspaces if need be.
   </p>
        <p>
      The WiFiSurvey application has a single source base for all target platforms and has
      been tested on the following platforms:
   </p>
        <ul>
          <li>
         ARM-based CE 6.0 with a 320x240 (landscape) display. 
      </li>
          <li>
         Pocket PC 2003 240x320 (portrait) 
      </li>
          <li>
         WinMo 5.0 240x320 (portrait and landscape)</li>
        </ul>
        <p>
      The IoC framework has additionally been tested on x86-based CE 5.0 and CE 6.0 devices.
   </p>
        <p>
      As a side note, the WiFiSurvey sample application is also a good example of using
      the OpenNETCF <a href="http://opennetcf.com/Products/SmartDeviceFramework/tabid/65/Default.aspx">Smart
      Device Framework</a> for getting wireless information.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=0a1aa3de-52b4-4b7e-a9d2-e958ef292434" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>Version 1.0 Release of IoC Framework along will full-blown sample</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,0a1aa3de-52b4-4b7e-a9d2-e958ef292434.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/24/Version10ReleaseOfIoCFrameworkAlongWillFullblownSample.aspx</link>
      <pubDate>Wed, 24 Jun 2009 18:54:24 GMT</pubDate>
      <description>&lt;p&gt;
   It took a long time to get here, but we've finally release what I'm calling the version
   1.0 (pervious version were 0.9.x) release of the &lt;a href="http://ioc.codeplex.com"&gt;OpenNETCF.IoC
   Framework&lt;/a&gt;.&amp;nbsp; In case you've not been tracking this project, it is a public-domain-licensed
   (you can't get any more free and unencumbered than that) framework that provides both &lt;a href="http://en.wikipedia.org/wiki/Inversion_of_control"&gt;inversion
   of control&lt;/a&gt; and &lt;a href="http://martinfowler.com/articles/injection.html"&gt;dependency
   injection&lt;/a&gt; for &lt;a href="http://msdn.microsoft.com/en-us/netframework/aa497273.aspx"&gt;.NET
   Compact Framework&lt;/a&gt; applications (it can be used on the desktop as well).&amp;nbsp;
   It's roughly modelled after &lt;a href="http://msdn.microsoft.com/en-us/library/aa480482.aspx"&gt;Microsoft's
   SCSF&lt;/a&gt; and CAB frameworks, but it's scaled down and optimized for running on mobile
   and embedded devices, plus I "fixed" stuff that I think the SCSF got wrong (like having
   a static, globally available &lt;a href="http://richnewman.wordpress.com/2007/09/09/creating-and-using-services-in-the-cab-introduction-to-the-cabscsf-part-8/"&gt;RootWorkItem&lt;/a&gt; and
   the ability to insert &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.imessagefilter.aspx"&gt;IMessageFilters&lt;/a&gt; into
   the application's message pump).
&lt;/p&gt;
&lt;p&gt;
   This framework is in use in a couple of commercial applications already, so it's been
   pretty heavily tested and vetted.&amp;nbsp; I still want to add a few more features as
   well and go back through it looking for performance optimizations, but it certainly
   has enough features to be used in applications today.
&lt;/p&gt;
&lt;p&gt;
   This release also ships with a full-blown, real-world sample application, not just
   the typical "Northwind" type of application.&amp;nbsp; The sample is called WiFiSurvey
   and it can be used to survey WiFi AP coverage of a site and to monitor associated
   AP changes as well as network addressability of a device.
&lt;/p&gt;
&lt;p&gt;
   WiFiSurvey has a Configuration service,&amp;nbsp;a &lt;a href="http://www.microsoft.com/Sqlserver/2008/en/us/compact.aspx"&gt;SQL
   CE 3.5&lt;/a&gt;-backed &lt;a href="http://en.wikipedia.org/wiki/Data_access_layer"&gt;Data Access
   Layer&lt;/a&gt;, an Infrastructure module and a an application shell all of which are fully
   decoupled from one another and that are all loaded dynamically using an XML definition
   file.&amp;nbsp; The shell makes use of both a DeckWorkspace and a TabWorkspace, showing
   you not just how to use them, but also how to create your own workspaces if need be.
&lt;/p&gt;
&lt;p&gt;
   The WiFiSurvey application has a single source base for all target platforms and has
   been tested on the following platforms:
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      ARM-based CE 6.0 with a&amp;nbsp;320x240 (landscape) display. 
   &lt;li&gt;
      Pocket PC 2003 240x320 (portrait) 
   &lt;li&gt;
      WinMo 5.0 240x320 (portrait and landscape)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
   The IoC framework has additionally been tested on x86-based CE 5.0 and CE 6.0 devices.
&lt;/p&gt;
&lt;p&gt;
   As a side note, the WiFiSurvey sample application is also a good example of using
   the OpenNETCF &lt;a href="http://opennetcf.com/Products/SmartDeviceFramework/tabid/65/Default.aspx"&gt;Smart
   Device Framework&lt;/a&gt; for getting wireless information.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=0a1aa3de-52b4-4b7e-a9d2-e958ef292434" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,0a1aa3de-52b4-4b7e-a9d2-e958ef292434.aspx</comments>
      <category>.NET Compact Framework;Compact Framework Code;Dependency Injection;Inversion of Control;OpenNETCF;OpenNETCF.IoC;Patterns and Practices;SDF Samples</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=6684f662-a046-43c8-ba2f-520b91ee5ff1</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,6684f662-a046-43c8-ba2f-520b91ee5ff1.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,6684f662-a046-43c8-ba2f-520b91ee5ff1.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=6684f662-a046-43c8-ba2f-520b91ee5ff1</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      So it seems that something has changed in CE 6.0 in the way that user inactivity is
      detected by the OS.  In CE 5.0 and before, if we wanted to keep the backlight
      on we could periodically call <a href="http://msdn.microsoft.com/en-us/library/aa930260.aspx">SystemIdleTimerReset</a> and
      all would be well.  In CE 6.0, this no longer works.  Now we have to set
      a named event that GWE is waiting on.  Here's what it looks like (this code uses
      the SDF for the <a href="http://www.opennetcf.com/library/sdf/html/b2928f45-5a95-1268-e6d7-f1d436a25bde.htm">named
      EventWaitHandle</a> - the CF doesn't provide one).
   </p>
        <p>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">private</span> EventWaitHandle
      m_activityEvent;<br /><br />
      [DllImport(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"coredll"</span>,
      SetLastError=<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">true</span>)]<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">private</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">static</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">extern</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">void</span> SystemIdleTimerReset();<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">private</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">void</span> ResetBacklightTimer()<br />
      {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"> 
      if</span> (Environment.OSVersion.Version.Major &lt;= 5)<br />
        {<br />
          SystemIdleTimerReset();<br />
        }<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"> 
      else</span><br />
        {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">   
      if</span> (m_activityEvent == <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">null</span>)<br />
          {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">     
      using</span> (var key <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> Registry.LocalMachine.OpenSubKey(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"System\\GWE"</span>))<br />
            {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">       
      object</span> value <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> key.GetValue(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"ActivityEvent"</span>);<br />
              key.Close();<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">       
      if</span> (value == <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">null</span>) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span>;</span>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <br />
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">       
      string</span> activityEventName <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> (<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">string</span>)value;<br />
              m_activityEvent <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> EventWaitHandle(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">false</span>,
      EventResetMode.AutoReset, activityEventName);<br />
            }<br />
          }<br /><br />
          m_activityEvent.Set();<br />
        }<br />
      }<br /></span>
        </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=6684f662-a046-43c8-ba2f-520b91ee5ff1" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>Preventing the backlight from turning off in CE 6.0</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,6684f662-a046-43c8-ba2f-520b91ee5ff1.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/17/PreventingTheBacklightFromTurningOffInCE60.aspx</link>
      <pubDate>Wed, 17 Jun 2009 21:11:25 GMT</pubDate>
      <description>&lt;p&gt;
   So it seems that something has changed in CE 6.0 in the way that user inactivity is
   detected by the OS.&amp;nbsp; In CE 5.0 and before, if we wanted to keep the backlight
   on we could periodically call &lt;a href="http://msdn.microsoft.com/en-us/library/aa930260.aspx"&gt;SystemIdleTimerReset&lt;/a&gt; and
   all would be well.&amp;nbsp; In CE 6.0, this no longer works.&amp;nbsp; Now we have to set
   a named event that GWE is waiting on.&amp;nbsp; Here's what it looks like (this code uses
   the SDF for the &lt;a href="http://www.opennetcf.com/library/sdf/html/b2928f45-5a95-1268-e6d7-f1d436a25bde.htm"&gt;named
   EventWaitHandle&lt;/a&gt; - the CF doesn't provide one).
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;private&lt;/span&gt; EventWaitHandle
   m_activityEvent;&lt;br&gt;
   &lt;br&gt;
   [DllImport(&lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"coredll"&lt;/span&gt;,
   SetLastError=&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;true&lt;/span&gt;)]&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;private&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;static&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;extern&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;void&lt;/span&gt; SystemIdleTimerReset();&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;private&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;void&lt;/span&gt; ResetBacklightTimer()&lt;br&gt;
   {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;
   if&lt;/span&gt; (Environment.OSVersion.Version.Major &amp;lt;= 5)&lt;br&gt;
   &amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; SystemIdleTimerReset();&lt;br&gt;
   &amp;nbsp; }&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;
   else&lt;/span&gt;
   &lt;br&gt;
   &amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
   if&lt;/span&gt; (m_activityEvent == &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;null&lt;/span&gt;)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
   using&lt;/span&gt; (var key &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; Registry.LocalMachine.OpenSubKey(&lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"System\\GWE"&lt;/span&gt;))&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
   object&lt;/span&gt; value &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; key.GetValue(&lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"ActivityEvent"&lt;/span&gt;);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key.Close();&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
   if&lt;/span&gt; (value == &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;null&lt;/span&gt;) &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt;;&lt;/span&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
   string&lt;/span&gt; activityEventName &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; (&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;string&lt;/span&gt;)value;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_activityEvent &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; EventWaitHandle(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;false&lt;/span&gt;,
   EventResetMode.AutoReset, activityEventName);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; m_activityEvent.Set();&lt;br&gt;
   &amp;nbsp; }&lt;br&gt;
   }&lt;br&gt;
&lt;/p&gt;
&gt;&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=6684f662-a046-43c8-ba2f-520b91ee5ff1" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,6684f662-a046-43c8-ba2f-520b91ee5ff1.aspx</comments>
      <category>Compact Framework Code;OpenNETCF;SDF Samples</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=c0a3706c-6c6b-4019-8581-d8dc22fe7323</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,c0a3706c-6c6b-4019-8581-d8dc22fe7323.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,c0a3706c-6c6b-4019-8581-d8dc22fe7323.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=c0a3706c-6c6b-4019-8581-d8dc22fe7323</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I've released yet another version of the <a href="http://ioc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28575">OpenNETCF.IoC
      Framework</a>.  This release has a few minor fixes over what I shipped last week,
      but more important is that it includes the start for a more complete example. 
      The new sample shows how to dynamically load modules based on a configuration XML
      document and how to use the DeckWorkspace.
   </p>
        <p>
      If you're using the framework, please let me know.  I see that it's been downloaded
      and we're getting some questions and bug reports, so I know that people are at least
      testing it out, but I've gotten no feedback as to whether anyone finds it useful of
      not.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=c0a3706c-6c6b-4019-8581-d8dc22fe7323" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>OpenNETCF.IoC Update</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,c0a3706c-6c6b-4019-8581-d8dc22fe7323.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/10/OpenNETCFIoCUpdate.aspx</link>
      <pubDate>Wed, 10 Jun 2009 20:51:53 GMT</pubDate>
      <description>&lt;p&gt;
   I've released yet another version of the &lt;a href="http://ioc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28575"&gt;OpenNETCF.IoC
   Framework&lt;/a&gt;.&amp;nbsp; This release has a few minor fixes over what I shipped last week,
   but more important is that it includes the start for a more complete example.&amp;nbsp;
   The new sample shows how to dynamically load modules based on a configuration XML
   document and how to use the DeckWorkspace.
&lt;/p&gt;
&lt;p&gt;
   If you're using the framework, please let me know.&amp;nbsp; I see that it's been downloaded
   and we're getting some questions and bug reports, so I know that people are at least
   testing it out, but I've gotten no feedback as to whether anyone finds it useful of
   not.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=c0a3706c-6c6b-4019-8581-d8dc22fe7323" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,c0a3706c-6c6b-4019-8581-d8dc22fe7323.aspx</comments>
      <category>OpenNETCF;OpenNETCF.IoC;Dependency Injection;Inversion of Control</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=8e12cb89-6829-48e2-a906-7b53faf14bb3</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,8e12cb89-6829-48e2-a906-7b53faf14bb3.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,8e12cb89-6829-48e2-a906-7b53faf14bb3.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=8e12cb89-6829-48e2-a906-7b53faf14bb3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      The new <a href="http://www.microsoft.com/video/en/us/details/8f51878c-fd0d-46ea-b5c2-82215564fbdd?vp_evt=eref&amp;vp_video=User+Interface+Technologies+for+Windows+Embedded+CE">Demo
      showing XAML for Windows CE</a> is really, really impressive.  This is non-WinMo,
      meaning CE no longer is a second-class citizen  in the device market.  If
      only I knew how to do design work....
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=8e12cb89-6829-48e2-a906-7b53faf14bb3" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>XAML for Windows CE</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,8e12cb89-6829-48e2-a906-7b53faf14bb3.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/05/XAMLForWindowsCE.aspx</link>
      <pubDate>Fri, 05 Jun 2009 22:48:26 GMT</pubDate>
      <description>&lt;p&gt;
   The new &lt;a href="http://www.microsoft.com/video/en/us/details/8f51878c-fd0d-46ea-b5c2-82215564fbdd?vp_evt=eref&amp;amp;vp_video=User+Interface+Technologies+for+Windows+Embedded+CE"&gt;Demo
   showing XAML for Windows CE&lt;/a&gt; is really, really impressive.&amp;nbsp; This is non-WinMo,
   meaning CE no longer is a second-class citizen&amp;nbsp; in the device market.&amp;nbsp; If
   only I knew how to do design work....
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=8e12cb89-6829-48e2-a906-7b53faf14bb3" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,8e12cb89-6829-48e2-a906-7b53faf14bb3.aspx</comments>
      <category>OpenNETCF;Ramblings</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=5f5560a2-cac1-4023-975b-7f3a711edf4e</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,5f5560a2-cac1-4023-975b-7f3a711edf4e.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,5f5560a2-cac1-4023-975b-7f3a711edf4e.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=5f5560a2-cac1-4023-975b-7f3a711edf4e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I've pushed up a new set of features and
   fixes for the OpenNETCF.<span class="searchword">IoC</span> Framework as well as rolled
   a new release. See the <a href="http://ioc.codeplex.com/"><strong><font color="#4682b4">Project Site</font></strong></a> for
   full details on what changed, but the general feature additions are that the framework
   now supports loading modules from configuration XML (you can now really decouple your
   app modules) and I added support for a DeckWorkspace and all the trappings around
   starting your app from a workspace.<img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=5f5560a2-cac1-4023-975b-7f3a711edf4e" /><br /><hr />
   Managed Code in the Embedded World</body>
      <title>More Bug fixes and improvements to OpenNETCF.IoC Framework </title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,5f5560a2-cac1-4023-975b-7f3a711edf4e.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/06/05/MoreBugFixesAndImprovementsToOpenNETCFIoCFramework.aspx</link>
      <pubDate>Fri, 05 Jun 2009 18:21:56 GMT</pubDate>
      <description>I've pushed up a new set of features and fixes for the OpenNETCF.&lt;span class=searchword&gt;IoC&lt;/span&gt; Framework
as well as rolled a new release. See the &lt;a href="http://ioc.codeplex.com/"&gt;&lt;strong&gt;&lt;font color=#4682b4&gt;Project&amp;nbsp;Site&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; for
full details on what changed, but the general feature additions are that the framework
now supports loading modules from configuration XML (you can now really decouple your
app modules) and I added support for a DeckWorkspace and all the trappings around
starting your app from a workspace.&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=5f5560a2-cac1-4023-975b-7f3a711edf4e" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,5f5560a2-cac1-4023-975b-7f3a711edf4e.aspx</comments>
      <category>.NET Compact Framework;OpenNETCF;OpenNETCF.IoC</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=df9c1990-5ea0-406e-8908-62daeda58776</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,df9c1990-5ea0-406e-8908-62daeda58776.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,df9c1990-5ea0-406e-8908-62daeda58776.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=df9c1990-5ea0-406e-8908-62daeda58776</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Detecting if your application has been idle (i.e. no user mouse or keyboard actions)
      for a certain period of time is straightforward using an IMessageFilter implementation. 
      The filter would look like this:
   </p>
        <p>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">using</span> System;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">using</span> System.Collections.Generic;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">using</span> System.Text;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">using</span> OpenNETCF.Win32;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">using</span> System.Windows.Forms;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">using</span> OpenNETCF.Windows.Forms;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">namespace</span> MessageFilterSample<br />
      {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"> 
      public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">class</span> InactivityFilter
      : IMessageFilter<br />
        {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">event</span> MethodInvoker
      InactivityElapsed;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>private</span> Timer
      m_inactivityTimer;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span> InactivityFilter(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> timeoutMilliseconds)<br />
          {<br />
            m_inactivityTimer <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> Timer();<br />
            m_inactivityTimer.Interval <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> timeoutMilliseconds;<br /><br />
            m_inactivityTimer.Tick += <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> EventHandler(m_inactivityTimer_Tick);<br />
            Reset();<br />
          }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>void</span> m_inactivityTimer_Tick(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">object</span> sender,
      EventArgs e)<br />
          {<br />
            m_inactivityTimer.Enabled <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">false</span>;<br />
            Elapsed <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">true</span>;<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>if</span> (InactivityElapsed
      !<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">null</span>)
      InactivityElapsed();<br />
          }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">bool</span> PreFilterMessage(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ref</span> Microsoft.WindowsCE.Forms.Message
      m)<br />
          {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>switch</span> ((WM)m.Msg)<br />
            {<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">        </font>case</span> WM.KEYUP:<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">        </font>case</span> WM.LBUTTONUP:<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">        </font>case</span> WM.MOUSEMOVE:<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"><font color="#000000">          </font>//
      reset the timer</span><br />
                m_inactivityTimer.Enabled <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">false</span>;<br />
                m_inactivityTimer.Enabled <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">true</span>;<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">          </font>break</span>;<br />
            }<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">      </font>return</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">false</span>;<br />
          }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">int</span> Timeout
      { get; set; }<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">bool</span> Elapsed
      { get; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">private</span> set;
      }<br /><br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><font color="#000000">    </font>public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">void</span> Reset()<br />
          {<br />
            Elapsed <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">false</span>;<br />
            m_inactivityTimer.Enabled <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">true</span>;<br />
          }<br />
        }<br />
      }</span>
        </p>
        <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
          <p>
      To use it, you must use one of the Run overloads in Application2 to start your application,
      then you can add your filter like this:
   </p>
          <p>
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">InactivityFilter
      m_filter <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> InactivityFilter(5000);<br />
      m_filter.InactivityElapsed += <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> MethodInvoker(m_filter_InactivityElapsed);<br />
      Application2.AddMessageFilter(m_filter);<br />
      ...<br /><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">void</span> m_filter_InactivityElapsed()<br />
      {<br />
         MessageBox.Show(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Inactivity
      timer fired"</span>);<br />
      }<br /></span>
          </p>
          <p>
      Download the sample here: 
      <br />
       
   </p>
        </span>
        <a href="http://blog.opennetcf.com/ctacke/content/binary/MessageFilterSample.zip">MessageFilterSample.zip
   (3.92 KB)</a>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=df9c1990-5ea0-406e-8908-62daeda58776" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>Detecting Application Idle</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,df9c1990-5ea0-406e-8908-62daeda58776.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/05/19/DetectingApplicationIdle.aspx</link>
      <pubDate>Tue, 19 May 2009 21:35:42 GMT</pubDate>
      <description>&lt;p&gt;
   Detecting if&amp;nbsp;your application has been idle (i.e. no user mouse or keyboard actions)
   for a certain period of time is straightforward using an IMessageFilter implementation.&amp;nbsp;
   The filter would look like this:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;using&lt;/span&gt; System;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;using&lt;/span&gt; System.Text;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;using&lt;/span&gt; OpenNETCF.Win32;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;using&lt;/span&gt; System.Windows.Forms;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;using&lt;/span&gt; OpenNETCF.Windows.Forms;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;namespace&lt;/span&gt; MessageFilterSample&lt;br&gt;
   {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&amp;nbsp;
   public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;class&lt;/span&gt; InactivityFilter
   : IMessageFilter&lt;br&gt;
   &amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;event&lt;/span&gt; MethodInvoker
   InactivityElapsed;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;private&lt;/span&gt; Timer
   m_inactivityTimer;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; InactivityFilter(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; timeoutMilliseconds)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_inactivityTimer &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; Timer();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_inactivityTimer.Interval &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; timeoutMilliseconds;&lt;br&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_inactivityTimer.Tick += &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; EventHandler(m_inactivityTimer_Tick);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reset();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;void&lt;/span&gt; m_inactivityTimer_Tick(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;object&lt;/span&gt; sender,
   EventArgs e)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_inactivityTimer.Enabled &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;false&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Elapsed &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;true&lt;/span&gt;;&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;if&lt;/span&gt; (InactivityElapsed
   !&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;null&lt;/span&gt;)
   InactivityElapsed();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;bool&lt;/span&gt; PreFilterMessage(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;ref&lt;/span&gt; Microsoft.WindowsCE.Forms.Message
   m)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;switch&lt;/span&gt; ((WM)m.Msg)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;case&lt;/span&gt; WM.KEYUP:&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;case&lt;/span&gt; WM.LBUTTONUP:&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;case&lt;/span&gt; WM.MOUSEMOVE:&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;//
   reset the timer&lt;/span&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_inactivityTimer.Enabled &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;false&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_inactivityTimer.Enabled &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;true&lt;/span&gt;;&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;break&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;return&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;false&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;int&lt;/span&gt; Timeout
   { get; set; }&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;bool&lt;/span&gt; Elapsed
   { get; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;private&lt;/span&gt; set;
   }&lt;br&gt;
   &lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;public&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;void&lt;/span&gt; Reset()&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Elapsed &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;false&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_inactivityTimer.Enabled &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;true&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
   &amp;nbsp; }&lt;br&gt;
   }&lt;/span&gt;
&lt;/p&gt;
&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt; 
&lt;p&gt;
   To use it, you must use one of the Run overloads in Application2 to start your application,
   then you can add your filter like this:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;InactivityFilter
   m_filter &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; InactivityFilter(5000);&lt;br&gt;
   m_filter.InactivityElapsed += &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;new&lt;/span&gt; MethodInvoker(m_filter_InactivityElapsed);&lt;br&gt;
   Application2.AddMessageFilter(m_filter);&lt;br&gt;
   ...&lt;br&gt;
   &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;void&lt;/span&gt; m_filter_InactivityElapsed()&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp;&amp;nbsp; MessageBox.Show(&lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"Inactivity
   timer fired"&lt;/span&gt;);&lt;br&gt;
   }&lt;br&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   Download the sample here: 
   &lt;br&gt;
   &amp;nbsp;
&lt;/p&gt;
&lt;/span&gt;&lt;a href="http://blog.opennetcf.com/ctacke/content/binary/MessageFilterSample.zip"&gt;MessageFilterSample.zip
(3.92 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=df9c1990-5ea0-406e-8908-62daeda58776" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,df9c1990-5ea0-406e-8908-62daeda58776.aspx</comments>
      <category>OpenNETCF;SDF Samples</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=d441c024-e10a-4163-b93e-21c91222c3b9</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,d441c024-e10a-4163-b93e-21c91222c3b9.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,d441c024-e10a-4163-b93e-21c91222c3b9.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=d441c024-e10a-4163-b93e-21c91222c3b9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      We've been doing a ton of internal work lately on our <a href="http://www.opennetcf.com/padarn.ocf">Padarn
      ASP.NET Web Server for Windows CE</a> - both on features as well as just the general
      stuff you have to do to have a product.  Part of this work was to create a series
      of hands-on labs to demonstrate how to use Padarn effectively.  The PDFs (a dozen in
      all so far), along with the latest Developer's Guide are available for public
      viewing on the <a href="http://opennetcf.com/Default.aspx?tabid=276">Padarn Downloads
      page</a>.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=d441c024-e10a-4163-b93e-21c91222c3b9" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>Padarn Lab Manuals available for Download</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,d441c024-e10a-4163-b93e-21c91222c3b9.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/05/13/PadarnLabManualsAvailableForDownload.aspx</link>
      <pubDate>Wed, 13 May 2009 23:47:53 GMT</pubDate>
      <description>&lt;p&gt;
   We've been doing a ton of internal work lately on our &lt;a href="http://www.opennetcf.com/padarn.ocf"&gt;Padarn
   ASP.NET Web Server for Windows CE&lt;/a&gt; - both on features as well as just the general
   stuff you have to do to have a product.&amp;nbsp; Part of this work was to create a series
   of hands-on labs to demonstrate how to use Padarn effectively.&amp;nbsp; The PDFs (a dozen&amp;nbsp;in
   all so far), along with the latest Developer's Guide&amp;nbsp;are available for public
   viewing on the &lt;a href="http://opennetcf.com/Default.aspx?tabid=276"&gt;Padarn Downloads
   page&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=d441c024-e10a-4163-b93e-21c91222c3b9" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,d441c024-e10a-4163-b93e-21c91222c3b9.aspx</comments>
      <category>OpenNETCF;Padarn</category>
    </item>
    <item>
      <trackback:ping>http://blog.opennetcf.com/ctacke/Trackback.aspx?guid=e2e2bd8d-d0ae-48fb-860b-005943083535</trackback:ping>
      <pingback:server>http://blog.opennetcf.com/ctacke/pingback.aspx</pingback:server>
      <pingback:target>http://blog.opennetcf.com/ctacke/PermaLink,guid,e2e2bd8d-d0ae-48fb-860b-005943083535.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://blog.opennetcf.com/ctacke/CommentView,guid,e2e2bd8d-d0ae-48fb-860b-005943083535.aspx</wfw:comment>
      <wfw:commentRss>http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetEntryCommentsRss?guid=e2e2bd8d-d0ae-48fb-860b-005943083535</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Admittedly this isn't really mobile related, but the guys over at <a href="http://ciadvantage.com/">CI
      Advantage</a> are <a href="http://ciadvantage.com/cs/content/FreeTShirt.aspx">giving
      away T-Shirts</a> with every download of the eval version of <a href="http://ciadvantage.com/cs/content/DeployNowOverview.aspx">Deploy
      Now</a> (which <u>we do</u> use and love here).  If you have desktop installations
      of anything, including mobile software or tools (we use it for testing the SDF
      installer scenarios, among other things) - it's a major time saver.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=e2e2bd8d-d0ae-48fb-860b-005943083535" />
        <br />
        <hr />
   Managed Code in the Embedded World</body>
      <title>Continuous Deployment</title>
      <guid>http://blog.opennetcf.com/ctacke/PermaLink,guid,e2e2bd8d-d0ae-48fb-860b-005943083535.aspx</guid>
      <link>http://blog.opennetcf.com/ctacke/2009/05/13/ContinuousDeployment.aspx</link>
      <pubDate>Wed, 13 May 2009 02:01:04 GMT</pubDate>
      <description>&lt;p&gt;
   Admittedly this isn't really mobile related, but the guys over at &lt;a href="http://ciadvantage.com/"&gt;CI
   Advantage&lt;/a&gt; are &lt;a href="http://ciadvantage.com/cs/content/FreeTShirt.aspx"&gt;giving
   away T-Shirts&lt;/a&gt; with every download of the eval version of &lt;a href="http://ciadvantage.com/cs/content/DeployNowOverview.aspx"&gt;Deploy
   Now&lt;/a&gt; (which &lt;u&gt;we do&lt;/u&gt; use and love here).&amp;nbsp; If you have desktop installations
   of anything, including mobile software or tools&amp;nbsp;(we use it for testing the SDF
   installer scenarios, among other things) - it's a major time saver.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/ctacke/aggbug.ashx?id=e2e2bd8d-d0ae-48fb-860b-005943083535" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Managed Code in the Embedded World</description>
      <comments>http://blog.opennetcf.com/ctacke/CommentView,guid,e2e2bd8d-d0ae-48fb-860b-005943083535.aspx</comments>
      <category>OpenNETCF;Ramblings</category>
    </item>
  </channel>
</rss>