ahmd0
ahmd0

Reputation: 17313

List devices that can wake system from sleep with C++ & disable/enable them?

I know that I can list devices that can wake Windows from a sleep mode using this command:

powercfg -devicequery wake_armed

I can then disable a device from waking computer by doing this:

powercfg -devicedisablewake "device name"

I'm curious, is there a similar way to do it with C++ using an API or by changing some registry values?

Upvotes: 2

Views: 631

Answers (1)

Lol4t0
Lol4t0

Reputation: 12557

You proabaly should use power management API functions.

Particularly, you can use DevicePowerEnumDevices function to list divices, that can wake up computer and DevicePowerSetDeviceState to enable/disable device from being sble to wake up computer.

Upvotes: 2

Related Questions