Home > Mobile >  Mouses cursor speed UWP C /CLI
Mouses cursor speed UWP C /CLI

Time:03-19

I am trying to get the mouse cursor speed in a windows UWP app using C /CLI. In a traditional Win32 App I would use the SystemParametersInfo function, something like:

SystemParametersInfo(
     SPI_SETMOUSESPEED, 
      0, 
      uint.Parse(args[0]), 
      0);

However, I do not have this available in an UWP app. I looked everywhere without any luck.

CodePudding user response:

I am trying to get the mouse cursor speed in a windows UWP app using C /CLI.

The problem is your uiAction is not correct. SPI_SETMOUSESPEED is used to set mouse speed. please use SPI_GETMOUSESPEED to replace.

Retrieves the current mouse speed. The mouse speed determines how far the pointer will move based on the distance the mouse moves. The pvParam parameter must point to an integer that receives a value which ranges between 1 (slowest) and 20 (fastest). A value of 10 is the default. The value can be set by an end-user using the mouse control panel application or by an application using SPI_SETMOUSESPEED.

SPI_GETMOUSESPEED
0x0070

SPI_SETMOUSESPEED
0x0071

CodePudding user response:

After having spend a lot of time investigating this, and not having received any answer, I think I will close of this issue, with the conclusion that this cannot be done in an UWP environment using C /CLI. It is apparently a restriction of an UWP App.

  • Related