How to detect Windows is locked?

扶醉桌前 提交于 2019-12-19 06:57:21

问题


How to detect Windows is locked (Win+L or locked by screensaver)? Is it possible?


回答1:


There is no documented way to check if the session is locked. There is however a way to detect that the session is getting locked. Use WTSRegisterSessionNotification(), you'll get a WM_WTSSESSION_CHANGE message with the WTS_SESSION_LOCK value when the workstation is being locked.

If you are planning to do this from a service then be sure to google "session 0 isolation" to find out why that doesn't work.



来源:https://stackoverflow.com/questions/8606300/how-to-detect-windows-is-locked

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