Hola tengo esto:
bool p = true;
SystemParametersInfo(SPI_SETMOUSECLICKLOCK, 0, &p, 0);
DWORD speed = 1300;
SystemParametersInfo(SPI_SETMOUSECLICKLOCKTIME, 0, &speed, 0);
SystemParametersInfo(SPI_GETMOUSECLICKLOCKTIME, 0, &speed, 0);
Se me activa bien pero luego al intentar cambiar la velocidad con SPI_SETMOUSECLICKLOCKTIME luego al recibir la, el speed ya es un numero como 3252721060 y el mouseLock no funciona. Si lo cambio desde el panel de control funciona y consigo apagar y encender desde c++ pero no cambiar la velocidad.
Donde fallo? En Microsoft pone:
Adjusts the time delay before the primary mouse button is locked. The uiParam parameter should be set to 0. The pvParam parameter points to a DWORD that specifies the time delay in milliseconds. For example, specify 1000 for a 1 second delay. The default is 1200
Saludos
Para SPI_SETMOUSECLICKLOCKTIME no tenes que pasar un puntero sino un valor entero tipo DWORD, castea tu variable a PVOID y listo.
Me da la impresion de que la documentacion esta mal: The pvParam parameter points to a DWORD that specifies the time delay in milliseconds.
Lo que hice fue depurar el rundll32.exe del Panel de Control, breakpoint en USER32!SystemParametersInfoW y en R8 (tercer parametro en x64) no habia ningun puntero ... aunque habia un comentario que lo advertia:
pvParam for SPI_SETMOUSECLICKLOCKTIME
For SPI_SETMOUSECLICKLOCKTIME, the pvParam value should specify the time directly. It is not a pointer to the DWORD specifying the time, as given in the documentation.
Priya26
2/16/2012
Justo lo probé y luego vi tu respuesta ;D
Como depuraste rundll32.exe yo al abrir el mouse y luego al intentar attach desde olly me sale ERROR_NOT_SUPPORTED ?
Creo que pasa lo mismo con SPI_SETMOUSECLICKLOCKTIME
Muy facil, yo uso WinDbg :silbar:
Y no hay menara de hacer lo con ollydgb ? Ahora no tengo instalado el windgb y no me apetece instalarlo.
No se, no uso ese depurador.