What is the best way to implement mouse wheel activity in Delphi VCL formats?

As a Delphi 7 user for a long time, I have processed my own manipulation of mouse wheels with several controls, but recently I noticed that some recent applications only need a mouse cursor to control it (for example, a box or tree view list) for mouse wheel activity to make this control scroll.
This seems enjoyable (as opposed to having to focus on the control before it responds to the wheel).

Now I moved to Delphi 2010 I wonder what the "right" behavior is?
And what can I use in Delphi, which allows me to abandon this using my own solutions?

Thanks.

0
source share
1 answer

I don’t know if there is an official β€œcorrect” behavior, but I personally find it the most intuitively correct when the mouse wheel moves to the window that the mouse cursor is currently moving without explicitly indicating focus. However, this is not the default behavior, and it seems that about half of the applications that I usually use do this one way and the other half the other way.

To receive mouse wheel messages without focus, you need to implement a mouse hook.

0
source

Source: https://habr.com/ru/post/901189/


All Articles