Programmatically Change Windows Power Settings

Is it possible to change the energy-saving behavior of a laptop computer on the cover next to sleep / standby / off to not do anything from the .NET Framework?

Edit: it would seem that by setting the value to standby mode and blocking the standby mode from my application, you can close the lid closing event, which I do after.

I found this question regarding the detection of a cover nearby, but it comes down to using a backup event or driver recording.

+3
source share
1 answer

Yes, you can use WMI classes.

WMI

, Application.SetSuspendState, . , ...

, , , ...

0

Source: https://habr.com/ru/post/1766716/


All Articles