[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.
BOOLEAN WritePwrScheme( PUINT puiID, LPCWSTR lpszSchemeName, LPCWSTR lpszDescription, PPOWER_POLICY lpScheme );
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.
The name of the power scheme.
The description of the power scheme.
A pointer to a POWER_POLICY structure that contains the power policy settings to be written.
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.
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.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|