Windows Message for User Locking Screen

拟墨画扇 提交于 2019-12-05 18:12:58
David Heffernan

The solution is to register for the WM_WTSSESSION_CHANGE and respond to it in your WndProc.

According to the documentation of WM_WTSSESSION_CHANGE, the minimum supported OS is XP. Now, the since Windows 2000 is no longer supported, the documentation often says XP is the minumum when in fact the functionality is available on earlier versions. In this case, a quick web search suggests that you may be disappointed.

To be notified about session logoff (rather then the screen lock), you should be able to use the lParam value of the WM_ENDSESSION message. Look for the presence of the ENDSESSION_LOGOFF flag.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!