by Richard Russell, January 2011
You can change the mouse speed, that is how fast the mouse pointer moves when you physically move the mouse, as follows:
SPI_SETMOUSESPEED = 113 SYS "SystemParametersInfo", SPI_SETMOUSESPEED, 0, speed%, 0
Where speed% has a value between 1 (slowest) and 20 (fastest). The default value is 10.
The above code changes the speed only for the current session. If you want to change the speed 'permanently' set the final parameter to 1:
SPI_SETMOUSESPEED = 113 SYS "SystemParametersInfo", SPI_SETMOUSESPEED, 0, speed%, 1
Note that the mouse is a shared resourse, so any change you make will affect all applications and utilities, not just your program.
You can discover the current mouse speed setting as follows:
SPI_GETMOUSESPEED = 112 SYS "SystemParametersInfo", SPI_GETMOUSESPEED, 0, ^speed%, 0
This will set speed% to the current value (note the very important ^ before the variable name).