I've basically copied the following code straight from the MSDN documentation:
#include <windows.h>
#include <stdio.h>
#pragma comment(lib, "user32.lib")
int main()
{
BOOL fResult;
int aMouseInfo[3]; // array for mouse information
// Get the current mouse speed.
fResult = SystemParametersInfo(
SPI_GETMOUSE, // get mouse information
0, // not used
&aMouseInfo, // holds mouse information
0); // not used
// Double it.
if( fResult )
{
aMouseInfo[2] = 1; // 2 * aMouseInfo[2];
// 1 should be a very noticeable change: slowing the cursor way down
// Change the mouse speed to the new value.
SystemParametersInfo(
SPI_SETMOUSE, // set mouse information
0, // not used
aMouseInfo, // mouse information
SPIF_SENDCHANGE); // update win.ini
}
return 0;
}
Yet when I run it, nothing seems to happen. The mouse speed should change, but it doesn't.
Windows Vista Home x32 (ouch) Dev-C++ Portable