systemparametersinfo (user32)
Last changed: -212.117.77.91

.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern bool SystemParametersInfo(uint uiAction, uint uiParam,
   IntPtr pvParam, uint fWinIni);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

// This code works for SPI_GETFOREGROUNDLOCKTIMEOUT, the above signature doesn't. (Ken)

[DllImport("user32.dll", EntryPoint="SystemParametersInfo", SetLastError = true)]

public static extern bool SystemParametersInfoGet(SystemParametersInfo action, uint param, ref uint vparam, uint init);

[DllImport("user32.dll", EntryPoint="SystemParametersInfo", SetLastError = true)]

public static extern bool SystemParametersInfoSet(SystemParametersInfo action, uint param, uint vparam, uint init);

// get current lock timeout value

uint timeout = 99;

bool retVal = SystemParametersInfoGet(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, ref timeout, 0);

// set current lock timeout value to 0, so focus can be grabbed

SystemParametersInfoSet(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, 0, 0);

Alternative Managed API:

Do you know one? Please contribute it!

Documentation