How can I get the scroll direction and sensitivity from WM_MOUSECROLL?

thebluetropics 1,046 Reputation points
2022-09-22T01:37:55.01+00:00

I tried to build a scrollable container with Direct2D, I know how to do that. I need to handle mouse scroll, as far as I know, the easiest way is to handle the WM_MOUSESCROLL message.

Here is my try:

   UINT direction = HIWORD(wparam);  

I used a debugger to see if it works, but its not. the variable direction always have a value 224, which is weird, even If I scroll both up and down.

What I want to achieve is:

  1. Get the scroll direction, up or down
  2. Get the scroll sensitivity, how much pixels it will be each scroll
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,447 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,560 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 82,036 Reputation points
    2022-09-22T03:50:51.783+00:00

0 additional answers

Sort by: Most helpful