问题
I'm trying to toggle mouse trails on and off with a keypress (windows key + q) using an autohotkey script, but can't get it working.
This is my code-
#q::
if DllCall("SystemParametersInfo", 94) < 2
{
DllCall("SystemParametersInfo", UInt, 0x005E, UInt, 0, UInt, 9, UInt, 0)
}else {
DllCall("SystemParametersInfo", UInt, 0x005E, UInt, 0, UInt, 0, UInt, 0)
}
return
Are you able to help?
回答1:
First read the value using SPI_GETMOUSETRAILS into a variable by reference (intP
) then set the new value using SPI_SETMOUSETRAILS:
#q::
DllCall("SystemParametersInfo", int,SPI_GETMOUSETRAILS:=0x5E, int,0, intP,length, int,0)
length := length > 1 ? 0 : 9
DllCall("SystemParametersInfo", int,SPI_SETMOUSETRAILS:=0x5D, int,length, int,0, int,0)
return
来源:https://stackoverflow.com/questions/32909204/toggling-mousetrail-on-keypress-with-autohotkey