I'm working with windows power management APIs (PowrProf.dll
P/Invokes) in C# to get and set power management settings of the system, but I'm not sure if the power management settings are user-specific or machine-specific :(
The flow for Windows XP is to get active power scheme (using GetActivePwrScheme()
), read global power settings (using ReadGlobalPwrPolicy()
), read scheme-specific settings (using ReadPwrScheme()
) and if necessary, write the modified data back to system (using SetActivePwrScheme()
).
The flow for windows vista and 7 is to get active power scheme (using PowerGetActiveScheme()
), read individual power settings (using PowerReadACValueIndex()
and PowerReadDCValueIndex()
) and if necessary, write the modified data back to system (using PowerWriteACValueIndex()
or PowerWriteDCValueIndex()
).
The thing is I prefer to run these codes in a windows service and am afraid that if I run these I'll be getting and setting power management settings for the SYSTEM account. I'm a little bit confused, please help.
Thanks in advance.