# win.ts.changeNotification 库模块帮助文档

## win.ts 成员列表 <a id="win.ts" href="#win.ts">&#x23;</a>

### win.ts.changeNotification <a id="win.ts.changeNotification" href="#win.ts.changeNotification">&#x23;</a>
监听用户对桌面会话的操作

### win.ts.changeNotification() <a id="win.ts.changeNotification" href="#win.ts.changeNotification">&#x23;</a>
[返回对象:wtsChangeNotificationObject](#wtsChangeNotificationObject)

### win.ts.changeNotification(窗口对象) <a id="win.ts.changeNotification" href="#win.ts.changeNotification">&#x23;</a>
注册文件监听窗口\监听用户对桌面会话的操作,  
省略参数则创建 message only window

## wtsChangeNotificationObject 成员列表 <a id="wtsChangeNotificationObject" href="#wtsChangeNotificationObject">&#x23;</a>

### wtsChangeNotificationObject._form <a id="wtsChangeNotificationObject._form" href="#wtsChangeNotificationObject._form">&#x23;</a>
[返回对象:winform](https://www.aardio.com/zh-cn/docs/library-reference/win/ui/_.html#winform)

### wtsChangeNotificationObject.deregister() <a id="wtsChangeNotificationObject.deregister" href="#wtsChangeNotificationObject.deregister">&#x23;</a>
注销并关闭监听

### wtsChangeNotificationObject.register(选项) <a id="wtsChangeNotificationObject.register" href="#wtsChangeNotificationObject.register">&#x23;</a>
注册并启用文件监视功能,  
所有参数都可以省略,默认使 _NOTIFY_FOR_ALL_SESSIONS 选项

## wtsChangeNotificationObject 事件列表 <a id="wtsChangeNotificationObjectEvent" href="#wtsChangeNotificationObjectEvent">&#x23;</a>

### wtsChangeNotificationObject.onSessionChange <a id="wtsChangeNotificationObject.onSessionChange" href="#wtsChangeNotificationObject.onSessionChange">&#x23;</a>

```aardio
wtsChangeNotificationObject.onSessionChange = function(sessionId,statusText,statusCode){  
		/*桌面会话改变触发此事件：例如用户登录，远程桌面连接断开等。  
恢复远程桌面会话时必须调用窗口的 enableDpiScaling() 方法更新 DPI 缩放大小*/  
}
```

### 自动完成常量
_NOTIFY_FOR_ALL_SESSIONS=1  
_NOTIFY_FOR_THIS_SESSION=0  
