Kernel32SetThreadExecutionState Method

Enables an application to inform the system that it is in use, thereby preventing the system from entering sleep or turning off the display while the application is running.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static ExecutionState SetThreadExecutionState(
	ExecutionState esFlags
)

Parameters

esFlags  ExecutionState
The thread's execution requirements.

This parameter can be one or more of the ExecutionState values.

Return Value

ExecutionState
If the function succeeds, the return value is the previous thread's ExecutionState value.

If the function fails, the return value is .

Remarks

See Also