I have a service, developed in C++ running on Windows 8 (and 8.1). How can I get to know that the system has entered Connected Standby?
Since this is a service, it does not have a window, I should be using PowerRegisterSuspendResumeNotification, but it does not seem to be working. Does anyone know how I can get such a notification?
When a user punches a key or touches the screen, the device instantly becomes operational. Connected Standby differs from sleep mode in its ability to instantly transition between an off-screen standby to an on-screen online mode.
Connected Standby mode is primarily a device's battery operating mode on the Windows operating system. In this mode, the device is turned on, but the display will be dark. Windows suspends all applications that may be running and puts the device in a state that consumers minimal power.
Open Command Prompt window, which can be done several ways, but typing "cmd" in the Taskbar search window will bring it up fast. Type "powercfg/a" and hit Enter and it will show you what sleep states your PC supports. If S0 Low Power Idle is listed as available, congratulations, you have Modern Standby.
To initiate entry to Modern Standby, press the power button, close the lid, or select Sleep from the power button in the Settings flyout. These actions should instantly power off the display. To wake up the system, simply press the power button or open the lid of the system.
I have contacted Microsoft's technical support. This is their answer:
There are no direct notifications for ConnectedStandby enter/exit, but you can just use the monitor on/off notifications since ConnectedStandby is synonymous with screen off on an AOAC capable system (but is not on a legacy system, AOAC capability can be had by getting SystemPowerCapabilities using CallNtPowerInformation and looking at the AoAc value of the SYSTEM_POWER_CAPABILITIES struct).
To get monitor on/off notifications you can use RegisterPowerSettingNotification and use the GUID_MONITOR_POWER_ON power setting GUID.
Looks like there is only a workaround for this by listening to screen on/off events.
This is excruciating unable to comment!!
CallNtPowerInformation(SystemPowerCapabilities, ...)
will return SYSTEM_POWER_CAPABILITIES
. It has an BOOLEAN
member AoAc
, if it is FALSE
, your system does not support connected standby.
It worked for me on an Intel custom hardware(same as machines in market). AoAc
= Always On Always Connected, Intel's preference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With