<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Chris Tacke</title>
  <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/" />
  <link rel="self" href="http://blog.opennetcf.com/ctacke/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2009-07-01T15:06:15.9550775-05:00</updated>
  <author>
    <name>Chris Tacke</name>
  </author>
  <subtitle>Bringing Managed Code to the Embedded World</subtitle>
  <id>http://blog.opennetcf.com/ctacke/</id>
  <generator uri="http://www.dasblog.net" version="1.8.5223.2">DasBlog</generator>
  <entry>
    <title>Padarn Evaluation Kits Now Available</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/07/01/PadarnEvaluationKitsNowAvailable.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,5afded23-76ae-489e-8876-7b7b33ee1bd5.aspx</id>
    <published>2009-07-01T15:06:15.9550775-05:00</published>
    <updated>2009-07-01T15:06:15.9550775-05:00</updated>
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="Padarn" label="Padarn" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>Padarn now supports VirtualPathProviders</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/29/PadarnNowSupportsVirtualPathProviders.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,afa181fc-622f-4d34-9a69-544de369c954.aspx</id>
    <published>2009-06-29T12:31:39.8889513-05:00</published>
    <updated>2009-06-29T12:31:39.8889513-05:00</updated>
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="Padarn" label="Padarn" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>OpenNETCF.IO.Serial Library moved to Codeplex</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/26/OpenNETCFIOSerialLibraryMovedToCodeplex.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,364731df-b779-4518-95b4-45bf9c1f7dc7.aspx</id>
    <published>2009-06-26T09:24:33.3567418-05:00</published>
    <updated>2009-06-26T09:24:33.3567418-05:00</updated>
    <category term=".NET Compact Framework" label=".NET Compact Framework" scheme="dasBlog" />
    <category term="Community" label="Community" scheme="dasBlog" />
    <category term="Desktop Development" label="Desktop Development" scheme="dasBlog" />
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>OpenNETCF.Desktop.Communication library has moved to Codeplex</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/25/OpenNETCFDesktopCommunicationLibraryHasMovedToCodeplex.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,8f35165e-f4c9-4042-bf33-c02c6a555d0f.aspx</id>
    <published>2009-06-25T18:38:36.9143078-05:00</published>
    <updated>2009-06-25T18:38:36.9143078-05:00</updated>
    <category term="Community" label="Community" scheme="dasBlog" />
    <category term="Desktop Development" label="Desktop Development" scheme="dasBlog" />
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>OpenNETCF.Telephony library (TAPI) released under shared-source license</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/25/OpenNETCFTelephonyLibraryTAPIReleasedUnderSharedsourceLicense.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,afbbd8b7-1a77-4331-90e0-ba53a43c179a.aspx</id>
    <published>2009-06-25T18:06:39.9130000-05:00</published>
    <updated>2009-06-25T18:06:53.8658323-05:00</updated>
    <category term="Community" label="Community" scheme="dasBlog" />
    <category term="Compact Framework Code" label="Compact Framework Code" scheme="dasBlog" />
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>ListView HitTest implementation</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/25/ListViewHitTestImplementation.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,147bb6f8-b6a9-4eb7-9b43-2a9ecb1aab67.aspx</id>
    <published>2009-06-25T11:38:57.1553233-05:00</published>
    <updated>2009-06-25T11:38:57.1553233-05:00</updated>
    <category term=".NET Compact Framework" label=".NET Compact Framework" scheme="dasBlog" />
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="SDF Samples" label="SDF Samples" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>Getting click events for a ListView in the Compact Framework.</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/25/GettingClickEventsForAListViewInTheCompactFramework.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,63666702-6b6e-4cb5-8f1b-e2fc688e3a7e.aspx</id>
    <published>2009-06-25T10:27:26.3238843-05:00</published>
    <updated>2009-06-25T10:27:26.3238843-05:00</updated>
    <category term="Compact Framework Code" label="Compact Framework Code" scheme="dasBlog" />
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="SDF Samples" label="SDF Samples" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>Version 1.0 Release of IoC Framework along will full-blown sample</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/24/Version10ReleaseOfIoCFrameworkAlongWillFullblownSample.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,0a1aa3de-52b4-4b7e-a9d2-e958ef292434.aspx</id>
    <published>2009-06-24T13:54:24.5010000-05:00</published>
    <updated>2009-06-24T21:53:48.6280093-05:00</updated>
    <category term=".NET Compact Framework" label=".NET Compact Framework" scheme="dasBlog" />
    <category term="Compact Framework Code" label="Compact Framework Code" scheme="dasBlog" />
    <category term="Dependency Injection" label="Dependency Injection" scheme="dasBlog" />
    <category term="Inversion of Control" label="Inversion of Control" scheme="dasBlog" />
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="OpenNETCF.IoC" label="OpenNETCF.IoC" scheme="dasBlog" />
    <category term="Patterns and Practices" label="Patterns and Practices" scheme="dasBlog" />
    <category term="SDF Samples" label="SDF Samples" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>Preventing the backlight from turning off in CE 6.0</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/17/PreventingTheBacklightFromTurningOffInCE60.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,6684f662-a046-43c8-ba2f-520b91ee5ff1.aspx</id>
    <published>2009-06-17T16:11:25.3414148-05:00</published>
    <updated>2009-06-17T16:11:25.3414148-05:00</updated>
    <category term="Compact Framework Code" label="Compact Framework Code" scheme="dasBlog" />
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="SDF Samples" label="SDF Samples" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>OpenNETCF.IoC Update</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/10/OpenNETCFIoCUpdate.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,c0a3706c-6c6b-4019-8581-d8dc22fe7323.aspx</id>
    <published>2009-06-10T15:51:53.1857273-05:00</published>
    <updated>2009-06-10T15:51:53.1857273-05:00</updated>
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="OpenNETCF.IoC" label="OpenNETCF.IoC" scheme="dasBlog" />
    <category term="Dependency Injection" label="Dependency Injection" scheme="dasBlog" />
    <category term="Inversion of Control" label="Inversion of Control" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>XAML for Windows CE</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/05/XAMLForWindowsCE.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,8e12cb89-6829-48e2-a906-7b53faf14bb3.aspx</id>
    <published>2009-06-05T17:48:26.9353188-05:00</published>
    <updated>2009-06-05T17:48:26.9353188-05:00</updated>
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="Ramblings" label="Ramblings" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>More Bug fixes and improvements to OpenNETCF.IoC Framework </title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/06/05/MoreBugFixesAndImprovementsToOpenNETCFIoCFramework.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,5f5560a2-cac1-4023-975b-7f3a711edf4e.aspx</id>
    <published>2009-06-05T13:21:56.4310000-05:00</published>
    <updated>2009-06-05T13:23:43.7248478-05:00</updated>
    <category term=".NET Compact Framework" label=".NET Compact Framework" scheme="dasBlog" />
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="OpenNETCF.IoC" label="OpenNETCF.IoC" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>Detecting Application Idle</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/05/19/DetectingApplicationIdle.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,df9c1990-5ea0-406e-8908-62daeda58776.aspx</id>
    <published>2009-05-19T16:35:42.6870000-05:00</published>
    <updated>2009-05-29T14:25:14.7093518-05:00</updated>
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="SDF Samples" label="SDF Samples" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>Padarn Lab Manuals available for Download</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/05/13/PadarnLabManualsAvailableForDownload.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,d441c024-e10a-4163-b93e-21c91222c3b9.aspx</id>
    <published>2009-05-13T18:47:53.0294441-05:00</published>
    <updated>2009-05-13T18:47:53.0294441-05:00</updated>
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="Padarn" label="Padarn" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
  <entry>
    <title>Continuous Deployment</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/ctacke/2009/05/13/ContinuousDeployment.aspx" />
    <id>http://blog.opennetcf.com/ctacke/PermaLink,guid,e2e2bd8d-d0ae-48fb-860b-005943083535.aspx</id>
    <published>2009-05-12T21:01:04.0888162-05:00</published>
    <updated>2009-05-12T21:01:04.0888162-05:00</updated>
    <category term="OpenNETCF" label="OpenNETCF" scheme="dasBlog" />
    <category term="Ramblings" label="Ramblings" scheme="dasBlog" />
    <content type="xhtml">
      <div 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
</div>
    </content>
  </entry>
</feed>