# sys.power.notification 库模块帮助文档

## sys.power 成员列表 <a id="sys.power" href="#sys.power">&#x23;</a>

### sys.power.notification <a id="sys.power.notification" href="#sys.power.notification">&#x23;</a>
用于注册接收电源设置或状态变更事件的通知窗体

注册接收电源设置或状态变更事件的通知窗口，  
相关文档： https://docs.microsoft.com/en-us/windows/win32/power/power-setting-guids

### sys.power.notification() <a id="sys.power.notification" href="#sys.power.notification">&#x23;</a>
[返回对象:sysPowerNotificationObject](#sysPowerNotificationObject)

### sys.power.notification(winform,guid,dataStruct) <a id="sys.power.notification" href="#sys.power.notification">&#x23;</a>
参数 @winform 必须指定父窗口,  
参数 @guid 可用字符串或 win.guid 对象指定事件 GUID，  
可选用参数 @dataStruct 指定解析回调参数值的结构体。  
如果结构体包含 value 字段，则回调参数值为 value 字段值。  
不指定 @dataStruct 则默认为 {INT value}

## sysPowerNotificationObject 成员列表 <a id="sysPowerNotificationObject" href="#sysPowerNotificationObject">&#x23;</a>

## sysPowerNotificationObject 事件列表 <a id="sysPowerNotificationObjectEvent" href="#sysPowerNotificationObjectEvent">&#x23;</a>

### sysPowerNotificationObject.onPowerResuming <a id="sysPowerNotificationObject.onPowerResuming" href="#sysPowerNotificationObject.onPowerResuming">&#x23;</a>

```aardio
onPowerResuming = function(automatic){
	/*自低耗电恢复触发此事件，  
系统自动恢复则 automatic 参数为 true，  
用户操作恢复则在数为 false*/
}
```

### sysPowerNotificationObject.onPowerSettingChange <a id="sysPowerNotificationObject.onPowerSettingChange" href="#sysPowerNotificationObject.onPowerSettingChange">&#x23;</a>

```aardio
onPowerSettingChange = function(guid,data){
	/*电源设置或设置状态变更，  
参数为 guid 为设置 GUID，  
data 为参数值*/  
}
```

### sysPowerNotificationObject.onPowerStatusChange <a id="sysPowerNotificationObject.onPowerStatusChange" href="#sysPowerNotificationObject.onPowerStatusChange">&#x23;</a>

```aardio
onPowerStatusChange = function(systemPowerStatus){
	/*电源状态变更，  
参数为 SYSTEM_POWER_STATUS 结构体，  
请参考该结构体相关资料*/  
}
```

