Setting Touchpad "AAPThreshold" Programmatically without sign off

17 Views Asked by At

I want to adjust the "AAPThreshold" value to 0 found in the registry path "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad" programtically and instantly like the UI touchpad settings does programmatically though.

I tried reading from SystemParametersInfo with SPI_GETMOUSE flag but it always showed the same results even after the UI and registry settings both changed the value

Code:

#include <iostream>
#include <windows.h>
using namespace std;

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);
    cout << aMouseInfo[0] << " " << aMouseInfo[1] << " " << aMouseInfo[2] << endl;
    return 0;
}

output

6 10 1

output after chaning touchpad from most sensitive to least sensitive

6 10 1
0

There are 0 best solutions below