title: Why isn't my app getting mouse wheel tilt messages?
body: <p>In this question <a href="https://stackoverflow.com/questions/1083691/how-to-detect-mouse-wheel-tilt"><em>How to detect mouse wheel tilt</em></a> an answer is posted and accepted that shows the code needed.</p>
  
  <p>I've implemented that code in my application's existing <code>WndProc</code> method (which is working for other messages I need to trap) but it's not working. I've checked and <code>WndProc</code> doesn't appear to be getting any messages at all let alone ones with a value of <code>0x020E</code> when I tilt the mouse wheel.</p>
  
  <p>I'm using a Microsoft Wireless Laser 5000 on Windows XP SP3 (fully patched) with .NET 3.5 SP1 installed.</p>
  
  <p>I've updated my Intellipoint drivers to version 7.0.258.0 dated 08/05/2009.</p>
  
  <p>Other applications (e.g. Visual Studio, Word, paint.NET) are getting and acting upon the mouse wheel being tilted so it must be my application, but I can't see what I'm doing wrong.</p>
  
  <p>Just for completeness here's my code:</p>
  
  <pre><code>    protected override void WndProc(ref Message m)
      {
          Trace.WriteLine(string.Format("0x{0:X4}", m.Msg));
          switch(m.Msg)
          {
              case WM_EXITSIZEMOVE:
                  Opacity = 1.0;
                  break;
              case WM_SYSCOMMAND:
                  int command = m.WParam.ToInt32() &amp; 0xfff0;
                  if (command == SC_MINIMIZE &amp;&amp; this.minimizeToTray)
                  {
                      MinimizeToTray();
                  }
                  break;
              case WM_MOUSEHWHEEL:
                  // Handle tilting here
                  break;
          }
          base.WndProc(ref m);
      }
  </code></pre>
  
  <p>The <code>Trace.WriteLine</code> call is an attempt to check if the tilt messages are getting through. The other messages <code>WM_EXITSIZEMOVE</code> and <code>WM_SYSCOMMAND</code> are being received. The messages are defined as:</p>
  
  <pre><code>    private const int WM_EXITSIZEMOVE = 0x0232;
      private const int WM_SYSCOMMAND = 0x0112;
      private const int SC_MINIMIZE = 0xF020;
      private const int WM_MOUSEHWHEEL = 0x020E;
  </code></pre>
  
  <p><strong>NOTE</strong> <em>I removed the [hardware] tag, as I'm 99% sure it's not the hardware that's at fault as other applications are receiving the messages.</em></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've added a multi-line textbox with scrollbars to my application and that receives and acts upon the mouse wheel tilt messages. So all I need to do is find the code for that ;)</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><a href="https://superuser.com/questions/29459/how-to-make-mouse-wheel-to-scroll-control-under-mouse-cursor">This question</a> on SuperUser may have some bearing on this - I'll keep an eye on answers there.</p>