Run a script when either locking or unlocking Wind

2019-03-27 10:32发布

问题:

I have a Windows XP machine and a Linux machine running Ubuntu. I share the keyboard/mouse from the Windows machine via Synergy. What I would like to do is lock/unlock the Linux machine whenever I lock/unlock the Windows machine.

So I'd like to be able to run a script of some description when Windows either locks or unlocks the screen.

回答1:

The standard way in Windows is to write a package (a dll) that subscribes to Winlogon notification events.

I don't know of any tool that provides an easy way to hook into those events, but you could make your package launch a script from some specific place if you really need your actions to be inside one.