SPI_GETMOUSE returns 0 的 SystemParametersInfoA

SystemParametersInfoA with SPI_GETMOUSE returns 0's

我正在尝试提高鼠标速度,但是当我使用参数 SPI_GETMOUSE 调用函数 SystemParametersInfoA 时,它会将目标数组设置为 {0,0,0},我认为这是不应该的发生。

示例代码:

int IntArr[3];
SystemParametersInfoA(SPI_GETMOUSE, 0, &IntArr, 0);

我尝试更改我的鼠标灵敏度(从控制面板),但也没有用。

这个函数应该return那些零还是我的错?

documentation 说:

Retrieves the two mouse threshold values and the mouse acceleration.

起初我确实认为这两个鼠标阈值与我的鼠标光标灵敏度有关。

docs for mouse_event, I found out that in the remarks section 中进行更深入的搜索后,它说:

The system applies two tests to the specified relative mouse motion when applying acceleration. If the specified distance along either the x or y axis is greater than the first mouse threshold value, and the mouse acceleration level is not zero, the operating system doubles the distance. If the specified distance along either the x- or y-axis is greater than the second mouse threshold value, and the mouse acceleration level is equal to two, the operating system doubles the distance that resulted from applying the first threshold test. It is thus possible for the operating system to multiply relatively-specified mouse motion along the x- or y-axis by up to four times.

这基本上意味着我在目标数组 IntArr 中获得的这 3 个值与灵敏度无关,但是而是这 2 个鼠标阈值和 "Enhance pointer precission",它是 01,表示它已 onoff我的被禁用了,这就是为什么我全是零。

为了获得鼠标灵敏度,您必须使用 SystemParametersInfoA function with the SPI_GETMOUSESPEED parameter as uiAction