开发者

Perform Task Just Before Windows Lockout

开发者 https://www.devze.com 2023-01-10 14:43 出处:网络
I\'m wondering if there is a way to intercept that a Windows session is about to be locked and essentially provide a pop-up just before.We\'ve got an intranet punch in/out facility, and many people fo

I'm wondering if there is a way to intercept that a Windows session is about to be locked and essentially provide a pop-up just before. We've got an intranet punch in/out facility, and many people forget to 开发者_如何学Gopunch in or out before leaving for lunch or for the day. Essentially I'm looking for a way to give the users the option to log out when they lock their machines.

I am also completely open to the possibility that this may not be possible due to security concerns, but I wanted to see what the community's take on it was anyway. Thanks!


Haven't tried it, but the Microsoft.Win32.SystemEvents class might have what you want.

Specifically, you may want to try the SessionSwitch event. According to this bytes.com post, it should work:

Handle the Windows Lock Desktop event/message?


You can use the Remote Desktop Services API WTSRegisterSessionNotification to get lock notifications, but there doesn't appear to be any way to override the lock.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号