Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6842763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:08:26+00:00 2026-05-27T00:08:26+00:00

I am trying to tidy up my code now that Delphi XE2 is available

  • 0

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 1 2 and 3. As with some of these answers, my own solution is a simple mouse message intercept using a TApplicationEvents component:

  procedure TForm6.ApplicationEvents1Message(var Msg: tagMSG;
  var Handled: Boolean);

  procedure ProcessMouseWheelMessage;
  begin
    Msg.message := WM_KEYDOWN;

    Msg.lParam := 0;

    If Integer(Msg.wParam) > 0 then
      Msg.wParam := VK_UP
    else
      Msg.wParam := VK_DOWN;

    Handled := False;
  end;

begin
  Case Msg.message of
    WM_MOUSEWHEEL :
      ProcessMouseWheelMessage;
  end;
end;

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?

Do I carry on with my solution or is there a better way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:08:27+00:00Added an answer on May 27, 2026 at 12:08 am

    In XE2 (and indeed all the recent releases) you don’t need to do anything. The standard controls support mouse wheel scrolling out of the box. Just get rid of this old code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get comfortable with jQuery and I have encountered some sample code that
I'm trying to tidy all my css code on my site, I want to
I'm trying to deserialize an XML that comes from a web service but I
i am trying to tidy up my code, i have a number of projects
I'm trying to tidy up my code. I have an array with 5 columns,
I am trying to keep my code tidy and move most of the functionality
I'm trying to parse the following HTML from the following URL: http://md5.rednoize.com/?q=fbade9e36a3f36d3d676c1b808451dd7 The code:
I'm trying to call the HtmlTidy library dll from C#. There's a few examples
I am trying to scrap some content from a website but the code below
I am trying to tidy up some legacy code. The following is a cut

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.