title: What is the recommended support for mouse-wheel capability in Delphi XE2?
body: <p>I am trying to tidy up my code now that Delphi XE2 is available - my code dates from Borland Pascal 7 so there are lots of 'old' (but working!) Win32 techniques and natually I have platform independence in mind too. Support for the mouse wheel has come up before here with several prior questions <a href="https://stackoverflow.com/questions/2251019/how-to-direct-the-mouse-wheel-input-to-control-under-cursor">1</a> <a href="https://stackoverflow.com/questions/8076524/delphi-7-handling-mousewheel-events-for-embedded-frames-in-forms">2</a> and <a href="https://stackoverflow.com/questions/456488/how-to-add-mouse-wheel-support-to-a-component-descended-from-tgraphiccontrol">3</a>. As with some of these answers, my own solution is a simple mouse message intercept using a TApplicationEvents component:</p>
  
  <pre><code>  procedure TForm6.ApplicationEvents1Message(var Msg: tagMSG;
    var Handled: Boolean);
  
    procedure ProcessMouseWheelMessage;
    begin
      Msg.message := WM_KEYDOWN;
  
      Msg.lParam := 0;
  
      If Integer(Msg.wParam) &gt; 0 then
        Msg.wParam := VK_UP
      else
        Msg.wParam := VK_DOWN;
  
      Handled := False;
    end;
  
  begin
    Case Msg.message of
      WM_MOUSEWHEEL :
        ProcessMouseWheelMessage;
    end;
  end;
  </code></pre>
  
  <p>I revisited this code today because 'Msg.wParam' is now NativeInt, breaking use of negative Msg.wParam values in the above code unless you use Integer(Msg.wParam). It made me notice that I had not seen any really definitive use of the mouse wheel for Delphi code - terrible when all mice now have wheels and Delphi is at the 'cutting edge' again! I would have expected a property, a component or some other more 'exposed' solution, and what about Fire Monkey wheel support?</p>
  
  <p>Do I carry on with my solution or is there a better way?</p>