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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("Kernel32.dll", ExactSpelling := true>]
Public Shared Function GetDevicePowerState (
hDevice As IntPtr,
<OutAttribute> ByRef refOn As Boolean
) As Boolean
Dim hDevice As IntPtr
Dim refOn As Boolean
Dim returnValue As Boolean
returnValue = Kernel32.GetDevicePowerState(hDevice,
refOn)
public:
[DllImportAttribute(L"Kernel32.dll", ExactSpelling = true)]
static bool GetDevicePowerState(
[InAttribute] IntPtr hDevice,
[OutAttribute] bool% refOn
)
[<DllImportAttribute("Kernel32.dll", ExactSpelling = true)>]
static member GetDevicePowerState :
hDevice : IntPtr *
refOn : bool byref -> bool
No code example is currently available or this language may not be supported.
- 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 .
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.