I want to call SystemParametersInfo from C #. The first argument to this function is one of a large set of possible values, such as SPI_GETACCESSTIMEOUT, which are listed in the documentation but are not displayed anywhere.
I can find the actual values ββof these things on the Internet and make an enumeration with the correct magic numbers in it - it works, but it doesnβt. I want to include something that does everything for me. They need to be defined somewhere!
What am I doing to get it right?
OJ points to the SPI page, and this is great if I want to copy all this into the source code. But I want the compiler to do this.
I can just say:
[DllImport("user32", CharSet = CharSet.Auto)] private static extern bool SystemParametersInfo(int uAction, bool uParam, int lpvParam, int fuWinIni); SystemParametersInfo(SPI_GETACCESSTIMEOUT, 0, ref IsActive, 0);
Instead, I need to add:
public const uint SPI_GETACCESSTIMEOUT = 0x003C;
... and everything else. I am looking for some team that will import all these definitions from anywhere they live in the dll.
c # include system-calls
Andrew
source share