I crave wisdom. I just cannot seem to suss this thing out.
I am needing to retrieve and set mouse acceleration from within Blitz. Basically this functionality is available via user32.dll's SystemParametersInfo function, using SPI_GETMOUSE and SPI_SETMOUSE :
SystemParametersInfo
BOOL SystemParametersInfo(
UINT uiAction,
UINT uiParam,
PVOID pvParam,
UINT fWinIni
);
Parameters
uiAction
[in] System-wide parameter to be retrieved or set. This parameter can be one of the following values. They are organized in tables of related parameters.
uiParam
[in] Depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify zero for this parameter.
pvParam
[in, out] Depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify NULL for this parameter.
fWinIni
[in] If a system parameter is being set, specifies whether the user profile is to be updated, and if so, whether the WM_SETTINGCHANGE message is to be broadcast to all top-level windows to notify them of the change.
This parameter can be zero if you don't want to update the user profile or broadcast the WM_SETTINGCHANGE message, or it can be one or more of the following values.
Value Meaning
SPIF_UPDATEINIFILE Writes the new system-wide parameter setting to the user profile.
SPIF_SENDCHANGE Broadcasts the WM_SETTINGCHANGE message after updating the user profile.
SPIF_SENDWININICHANGE Same as SPIF_SENDCHANGE.
the uiAction parameters I am interested in are:
SPI_GETMOUSE - Retrieves the two mouse threshold values and the mouse acceleration. The pvParam parameter must point to an array of three integers that receives these values. See mouse_event for further information.
SPI_SETMOUSE - Sets the two mouse threshold values and the mouse acceleration. The pvParam parameter must point to an array of three integers that specifies these values. See mouse_event for further information.
I have a user32.decls containing the following:
.lib "user32.dll"
SystemParametersInfo%(uAction%, uParam%, lpvParam*, fuWinIni%) : "SystemParametersInfoA"
and finally, a bit of test blitz code:
I've done dll calls before, but this one just seems to be getting the better of me. Everything else seems to pretty much make sense except the uiAction. I cannot suss out how to retrieve the SPI_GETMOUSE and SPI_SETMOUSE parameters. I'm probably off the mark here, but isn't 'uiAction' an integer, as denoted by the '%'? In which case, how on earth can it equal SPI_GETMOUSE?
To cut a long story short, what do I have to change '????????' in the example in order for it to work?
SystemParametersInfo hates me.
Thanks.
I am needing to retrieve and set mouse acceleration from within Blitz. Basically this functionality is available via user32.dll's SystemParametersInfo function, using SPI_GETMOUSE and SPI_SETMOUSE :
SystemParametersInfo
BOOL SystemParametersInfo(
UINT uiAction,
UINT uiParam,
PVOID pvParam,
UINT fWinIni
);
Parameters
uiAction
[in] System-wide parameter to be retrieved or set. This parameter can be one of the following values. They are organized in tables of related parameters.
uiParam
[in] Depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify zero for this parameter.
pvParam
[in, out] Depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify NULL for this parameter.
fWinIni
[in] If a system parameter is being set, specifies whether the user profile is to be updated, and if so, whether the WM_SETTINGCHANGE message is to be broadcast to all top-level windows to notify them of the change.
This parameter can be zero if you don't want to update the user profile or broadcast the WM_SETTINGCHANGE message, or it can be one or more of the following values.
Value Meaning
SPIF_UPDATEINIFILE Writes the new system-wide parameter setting to the user profile.
SPIF_SENDCHANGE Broadcasts the WM_SETTINGCHANGE message after updating the user profile.
SPIF_SENDWININICHANGE Same as SPIF_SENDCHANGE.
the uiAction parameters I am interested in are:
SPI_GETMOUSE - Retrieves the two mouse threshold values and the mouse acceleration. The pvParam parameter must point to an array of three integers that receives these values. See mouse_event for further information.
SPI_SETMOUSE - Sets the two mouse threshold values and the mouse acceleration. The pvParam parameter must point to an array of three integers that specifies these values. See mouse_event for further information.
I have a user32.decls containing the following:
.lib "user32.dll"
SystemParametersInfo%(uAction%, uParam%, lpvParam*, fuWinIni%) : "SystemParametersInfoA"
and finally, a bit of test blitz code:
Type mouseparams Field amouse Field bmouse Field cmouse End Type workdammit.mouseparams=New mouseparams SystemParametersInfo(????????, 0, workdammit, 0) Print workdammit\amouse Print workdammit\bmouse Print workdammit\cmouse
I've done dll calls before, but this one just seems to be getting the better of me. Everything else seems to pretty much make sense except the uiAction. I cannot suss out how to retrieve the SPI_GETMOUSE and SPI_SETMOUSE parameters. I'm probably off the mark here, but isn't 'uiAction' an integer, as denoted by the '%'? In which case, how on earth can it equal SPI_GETMOUSE?
To cut a long story short, what do I have to change '????????' in the example in order for it to work?
SystemParametersInfo hates me.
Thanks.