Expand Minimize

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.]

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 [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

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

 

 

Community Additions

ADD
Show:
© 2014 Microsoft