PowrProfPowerReadFriendlyName Method
Retrieves the friendly name for the specified power setting, subgroup, or scheme.
If the
schemeGuid parameter is not
but both the
subGroupOfPowerSettingsGuid and
powerSettingGuid parameters
are
Zero, the friendly name of the power scheme will be returned.
If the
schemeGuid is not
,
and
subGroupOfPowerSettingsGuid parameter is not
Zero,
and the
powerSettingGuid parameter is
Zero,
the friendly name of the subgroup will be returned.
If the
schemeGuid is not
,
and
subGroupOfPowerSettingsGuid and
powerSettingGuid parameters
are not
Zero, the friendly name of the power setting will be returned.
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("PowrProf.dll")]
public static Win32ErrorCode PowerReadFriendlyName(
IntPtr rootPowerKey,
Guid schemeGuid,
IntPtr subGroupOfPowerSettingsGuid,
IntPtr powerSettingGuid,
IntPtr buffer,
ref uint refBufferSize
)
<DllImportAttribute("PowrProf.dll">]
Public Shared Function PowerReadFriendlyName (
rootPowerKey As IntPtr,
schemeGuid As Guid,
subGroupOfPowerSettingsGuid As IntPtr,
powerSettingGuid As IntPtr,
buffer As IntPtr,
ByRef refBufferSize As UInteger
) As Win32ErrorCode
Dim rootPowerKey As IntPtr
Dim schemeGuid As Guid
Dim subGroupOfPowerSettingsGuid As IntPtr
Dim powerSettingGuid As IntPtr
Dim buffer As IntPtr
Dim refBufferSize As UInteger
Dim returnValue As Win32ErrorCode
returnValue = PowrProf.PowerReadFriendlyName(rootPowerKey,
schemeGuid, subGroupOfPowerSettingsGuid,
powerSettingGuid, buffer, refBufferSize)
public:
[DllImportAttribute(L"PowrProf.dll")]
static Win32ErrorCode PowerReadFriendlyName(
IntPtr rootPowerKey,
Guid schemeGuid,
IntPtr subGroupOfPowerSettingsGuid,
IntPtr powerSettingGuid,
IntPtr buffer,
unsigned int% refBufferSize
)
[<DllImportAttribute("PowrProf.dll")>]
static member PowerReadFriendlyName :
rootPowerKey : IntPtr *
schemeGuid : Guid *
subGroupOfPowerSettingsGuid : IntPtr *
powerSettingGuid : IntPtr *
buffer : IntPtr *
refBufferSize : uint32 byref -> Win32ErrorCode
No code example is currently available or this language may not be supported.
- rootPowerKey IntPtr
-
Reserved for future use, this must be set to Zero.
- schemeGuid Guid
-
The Guid referring to the power scheme.
- subGroupOfPowerSettingsGuid IntPtr
-
The subgroup of power settings.
If this parameter is ,
an enumeration of settings under the PolicyGuid key is returned.
- powerSettingGuid IntPtr
- buffer IntPtr
-
A pointer to a buffer that receives the friendly name.
If this parameter is ,
the refBufferSize parameter receives the required buffer size.
The strings returned are all wide (Unicode) strings.
- refBufferSize UInt32
-
A pointer to a variable that contains the size of the buffer pointed to by the Buffer parameter.
Win32ErrorCode
Returns
ERROR_SUCCESS (zero) if the call was successful,
and a nonzero value if the call failed.
If the buffer size specified by the
refBufferSize parameter is too small,
ERROR_MORE_DATA will be returned and the DWORD pointed to by the
refBufferSize parameter will be filled in with the required buffer size.