Kernel32GetDevicePowerState Method

Retrieves the current power state of the specified device.

This function cannot be used to query the power state of a display device.

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", ExactSpelling = true)]
public static bool GetDevicePowerState(
	IntPtr hDevice,
	out bool refOn
)

Parameters

hDevice  IntPtr
A handle to an object on the device, such as a file or socket, or a handle to the device itself.
refOn  Boolean
A pointer to the variable that receives the power state.

This value is if the device is in the working state. Otherwise, it is .

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

Remarks

See Also