[英]Switch logged in User Session Event capture from MFC Application in Windows
I have an MFC dialog based application.我有一个基于 MFC 对话框的应用程序。 Please anyone tell me how to capture the Switch user(windows logged in user) event from this MFC program.
请任何人告诉我如何从这个 MFC 程序捕获切换用户(Windows 登录用户)事件。
I tried to capture the WM_QUERYENDSESSION from the Dialog's WindowProc function and I could able to capture the Shutdown, Restart and log off events using WM_QUERYENDSESSION.我试图从对话框的 WindowProc 函数中捕获 WM_QUERYENDSESSION,我可以使用 WM_QUERYENDSESSION 捕获关闭、重新启动和注销事件。 But the "Switch user" event is not getting called with WM_QUERYENDSESSION.
但是 WM_QUERYENDSESSION 不会调用“切换用户”事件。
Any help is much appreciated.任何帮助深表感谢。
Have a look at the WM_WTSSESSION_CHANGE
message.查看
WM_WTSSESSION_CHANGE
消息。 Your application needs to call WTSRegisterSessionNotification()
to receive this message.您的应用程序需要调用
WTSRegisterSessionNotification()
来接收此消息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.