My goal is to create a little software to change dynamically the mouse speed of my mouse. I want to create a .dll of it and insert to my Unity Project to give the choice of my player to choose their mouse sensitivity.
On my research I found this topic with the code below:
public const UInt32 SPI_SETMOUSESPEED = 0x0071;
[DllImport("User32.dll")]
static extern Boolean SystemParametersInfo(
UInt32 uiAction,
UInt32 uiParam,
UInt32 pvParam,
UInt32 fWinIni);
static void Main(string[] args)
{
for (int i = 0; i < args.Length; i++)
{
System.Console.WriteLine("Arg[{0}] = [{1}]", i, args[i]);
}
SystemParametersInfo(
SPI_SETMOUSESPEED,
0,
uint.Parse(args[0]),
0);
}
But, when I try to use this code in my Visual Studio I have this error:
System.IndexOutOfRangeException: 'The index is outside the bounds of the array.'
I tried to use the breakpoint, but this is not working, and I don't understand what is going in my arg[0].
I'm new in pur C# and I would like to know if I have to create a windows or handle input in order to have my program working.
Thanks :)