Reputation: 31
how to tell windows to set lid action to do nothing in C++ or to not to hibernate or sleep
like when you go to Control Panel\Hardware and Sound\Power Options choose what lid closing action do and choose one of the 4 options but programmatically somthing like
SetLidaction(DO_NOTHING);
Upvotes: 1
Views: 364
Reputation: 11954
You could use CallNtPowerInformation with parameter SystemPowerPolicyCurrent
to receive the current value of SYSTEM_POWER_POLICY and then change its LidClose
and apply it back with the same CallNtPowerInformation.
Upvotes: 3