|
1
16
A. SessionSwitch 这次活动可能是你最好的选择。检查 SessionSwitchReason 通过了 SessionSwitchEventArgs |
|
|
2
3
您可以通过WM_WTSSESSION_CHANGE消息获得此通知。您必须通过WTSRegisterSessionNotification通知Windows要接收这些消息,并使用WTSUnRegisterSessionNotification注销。 这些文章应该对C#的实现有所帮助。 http://pinvoke.net/default.aspx/wtsapi32.WTSRegisterSessionNotification http://blogs.msdn.com/shawnfa/archive/2005/05/17/418891.aspx http://bytes.com/groups/net-c/276963-trapping-when-workstation-locked |
|
|
3
2
这里有一个示例类来概括这一点。
|
|
|
4
-3
你绝对不需要WM_WTSSESSION_CHANGE 只需使用内部WTTS API。 |