#Include <WinAPI.au3>
Global Const $SPI_GETMOUSESPEED = 112 ; 0x0070
Global Const $SPI_SETMOUSESPEED = 113 ; 0x0071
; Get individual setting :
Global $g_tMouseSpeed = DllStructCreate('int Speed')
_WinAPI_SystemParametersInfo($SPI_GETMOUSESPEED, 0, DllStructGetPtr($g_tMouseSpeed), 0)
ConsoleWrite("MouseSpeed (individual) = " & $g_tMouseSpeed.Speed & @CRLF)
; Info : value ranges between 1 (slowest) and 20 (fastest) - 10 is the default
; 1. Set speed to 1 = 'slowest' (for 4 sec.)
_WinAPI_SystemParametersInfo($SPI_SETMOUSESPEED, 0, 1, 2)
ConsoleWrite("MouseSpeed = 1 ('slowest')" & @CRLF)
Sleep(4000)
; 2. Set speed to 20 = 'fastest' (for 4 sec.)
_WinAPI_SystemParametersInfo($SPI_SETMOUSESPEED, 0, 20, 2)
ConsoleWrite("MouseSpeed = 20 ('fastest')" & @CRLF)
Sleep(4000)
; 3. Set speed back to individual setting
_WinAPI_SystemParametersInfo($SPI_SETMOUSESPEED, 0, $g_tMouseSpeed.Speed, 2)