Checking for workstation lock/unlock change with c#

前端 未结 4 1729
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 22:27

DUPLICATE: How can I programmatically determine if my workstation is locked?

How can I detect (during runtime) when a Windows user has locked their

4条回答
  •  庸人自扰
    2020-12-09 22:29

    A SessionSwitch event may be your best bet for this. Check the SessionSwitchReason passed through the SessionSwitchEventArgs to find out what kind of switch it is and react appropriately.

提交回复
热议问题