Is this Mouse Speed code correct?
Posted: Tue May 24, 2005 7:41 pm
This is a little DLL I'm trying to write which is supposed to use the USER32 SystemParametersInfo function to get and set the mouse speed. I'm using it as a DLL because I need to call it from Blitz3d.
GetMouseSpeed is currently returning 0, regardless of the mouse setting, so I'm evidently doing something wrong. It *could* be the way I'm calling the DLL from Blitz, in which case I'll have to ask over there how to call it, but I'd like to know if the code itself looks sound.
GetMouseSpeed is currently returning 0, regardless of the mouse setting, so I'm evidently doing something wrong. It *could* be the way I'm calling the DLL from Blitz, in which case I'll have to ask over there how to call it, but I'd like to know if the code itself looks sound.
Code: Select all
#SPI_GETMOUSESPEED=112
#SPI_SETMOUSESPEED=113
ProcedureDLL.l GetMouseSensitivity()
MouseSpeed.l=0
SystemParametersInfo_(#SPI_GETMOUSESPEED,0,*MouseSpeed,#SPIF_SENDWININICHANGE)
ProcedureReturn MouseSpeed
EndProcedure
ProcedureDLL SetMouseSensitivity(Sense.l)
SystemParametersInfo_(#SPI_SETMOUSESPEED,0,Sense,#SPIF_SENDWININICHANGE)
EndProcedure