简体   繁体   English

Windows XP和Windows 7之间注销通知事件的差异

[英]Difference in Logoff notification events between Windows XP and Windows 7

I have a service / application which receives notifications of Windows session changes. 我有一个服务/应用程序,它接收Windows会话更改的通知。 I have noted a difference in behaviour between Windows XP and Windows 7 and am trying to establish if it is a bug or a documented change of behaviour. 我已经注意到Windows XP和Windows 7之间的行为存在差异,并且我正在尝试确定它是否是一个错误或记录的行为变化。

The notifications come in as a: WTSSESSION_NOTIFICATION . 通知以: WTSSESSION_NOTIFICATION

Windows XP reports as expected: WTS_SESSION_LOGON at windows GUI logon and: WTS_SESSION_LOGOFF at Windows GUI logoff. Windows XP中报告预期: WTS_SESSION_LOGON在Windows图形用户界面登录和: WTS_SESSION_LOGOFF在Windows图形用户界面注销。

Under Windows 7 x64 at gui login WTS_SESSION_LOGON is generated but at logoff I get a WTS_CONSOLE_DISCONNECT event instead of the WTS_SESSION_LOGOFF event. 在Windows 7 x64下,在gui登录WTS_SESSION_LOGON会生成WTS_SESSION_LOGON ,但在注销时,我会收到WTS_CONSOLE_DISCONNECT事件而不是WTS_SESSION_LOGOFF事件。

Is this a bug or have the constant values changed between versions? 这是一个错误还是版本之间的常量值有变化? It is not massively critical for the service I have developed but I would still like to know why this behaves differently. 它对我开发的服务并不是非常关键,但我仍然想知道为什么这种行为有所不同。

只有服务可以在Windows 7下接收WTS_SESSION_LOGOFF事件。到服务获取通知时,注销过程结束(因此用户运行的所有应用程序都已被终止)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM