How can I get the mouse wheel vertical scroll rate

2019-07-07 17:12发布

问题:

I'm currently developping a custom control, and, to implement vertical scrolling, I want to be able to fetch the configured vertical scroll rate (described here). I would use this setting to move the control by [X] number of lines.

回答1:

You can get it from SystemParametersInfo function with SPI_GETWHEELSCROLLLINES.

Retrieves the number of lines to scroll when the vertical mouse wheel is moved. The pvParam parameter must point to a UINT variable that receives the number of lines. The default value is 3.