Hello everybody!
I have some goals, some of those:
-enable/disable screensaver mode
-enable/disable sleep mode of HDD
-enable/disable turn off display
-enable/disable sleep mode
I'am googlin' almost 3 days! and found a small part of info, that didn't help me.
I tried to change this settings through Registry but it was unsuccessful because I don't have administrator permission, I got ACCESS_DENIED.
I found Power management API, but I am not sure how use it. MSDN is not full of information.
--I have used SetThreadExecutionState and SystemParametersInfo for Screen saver, but those solutions works bad. First I can't be sure is it enable or disabled, second with bug.
--I tried to use Registry, but my application without admin. permission, taht's why I got
ACCESS_DENIED
--I found Power Management API. I don't know how use it. Especially PowerWritePossibleValue.
Provide me some examples to use this api.
Am I on correct way?How can use Power Management API for my tasks?
Please write me if you know another solutions
Thanks a lot
P.S: I searched all MSDN is not full info and a lot of links in goodgle
Bonus question:
I'm a student and newer in programming is it good that my application can change options of OS
itself (for example: In options, turn off display for 10 minutes, programmatically I can change on Never)?