0 out of 1 rated this helpful - Rate this topic

WritePwrScheme function

[WritePwrScheme is no longer available for use as of Windows Vista. Instead, use the PowerEnumerate function to enumerate power settings for a specified scheme, and the power write functions to write individual settings.]

Applies to: desktop apps only

Writes policy settings that are unique to the specified power scheme.

Syntax

BOOLEAN WINAPI WritePwrScheme(
  __in      PUINT puiID,
  __in      LPWSTR lpszName,
  __in_opt  LPWSTR lpszDescription,
  __in      PPOWER_POLICY pPowerPolicy
);

Parameters

puiID [in]

The index of the power scheme to be written. If a power scheme with the same index already exists, it is replaced. Otherwise, a new power scheme is created.

lpszName [in]

The name of the power scheme.

lpszDescription [in, optional]

The description of the power scheme.

pPowerPolicy [in]

A pointer to a POWER_POLICY structure that contains the power policy settings to be written.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

This change does not affect the current system power policy. To apply this change to the current system power policy, call the SetActivePwrScheme function with the index of this power scheme.

Power policy schemes written using WritePwrScheme are permanently stored in the system registry hives, and remain available for use in the Power Options control panel program, or by subsequent calls to the power scheme API. To permanently remove a power scheme from the system, call the DeletePwrScheme function.

For more information about using PowrProf.h, see Power Schemes.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

End of client support

Windows XP

End of server support

Windows Server 2003

Header

PowrProf.h

Library

PowrProf.lib

DLL

PowrProf.dll

See also

Power Schemes
Power Management Functions
DeletePwrScheme
POWER_POLICY
ReadPwrScheme
SetActivePwrScheme

 

 

Send comments about this topic to Microsoft

Build date: 2/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ