'Mouses cursor speed UWP C++/CLI

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.



Solution 1:[1]

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.

Solution 2:[2]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jakob Randa
Solution 2 Nico Zhu - MSFT