W8服务的已连接待机通知 [英] Connected standby notification for a W8 Service

查看:838
本文介绍了W8服务的已连接待机通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个服务,开发在C + +运行在Windows 8(和8.1)。我如何知道系统已进入连接待机?

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?

由于这是一个服务,它没有窗口,我应该使用 PowerRegisterSuspendResumeNotification ,但它似乎不工作。有人知道我如何获得这样的通知吗?

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?

推荐答案

我已联系Microsoft的技术支持。这是他们的答案:

I have contacted Microsoft's technical support. This is their answer:


没有直接通知ConnectedStandby进入/退出,但你可以使用监视器开/ ConnectedStandby与AOAC系统上的屏幕关闭同义(但不是在传统系统上,可以通过使用CallNtPowerInformation获取SystemPowerCapabilities并查看SYSTEM_POWER_CAPABILITIES结构的AoAc值来获得AOAC功能)。

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).

要获得监视器的开/关通知,您可以使用RegisterPowerSettingNotification并使用GUID_MONITOR_POWER_ON电源设置GUID。

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.

这篇关于W8服务的已连接待机通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆