Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何检测 Windows 是否被锁定(Win+L 或被屏幕保护程序锁定)?是否可以?
没有记录的方法来检查会话是否被锁定。然而,有一种方法可以检测会话是否被锁定。使用 WTSRegisterSessionNotification(),当工作站被锁定时,您将收到带有 WTS_SESSION_LOCK 值的 WM_WTSSESSION_CHANGE 消息。
如果您打算从服务中执行此操作,请务必使用谷歌搜索“会话 0 隔离”以找出为什么它不起作用。