Lock computer when a device is disconnected

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Posts: 1
Joined: 06 Aug 2018, 19:48

Lock computer when a device is disconnected

12 Aug 2018, 20:18

Hello, I'm new to AutoHotkey and I'm totally clueless.

What I want to achieve is, to lock the computer when a certain device is disconnected.

I tried using 'OnMessage', but the only function related is 'WM_DEVICECHANGE = 0x219'.

If I use that, you can't specify which device triggers the action, also a new connection will also count. I want a certain device's disconnect to trigger the action, that is locking my computer. Is that achievable?

Any help is greatly appreciated... thanks a lot in advance everyone.
User avatar
Posts: 1044
Joined: 15 Nov 2014, 21:31
GitHub: Flipeador
Location: Argentina

Re: Lock computer when a device is disconnected

12 Aug 2018, 21:31

Windws 1♂ Pro 64-Bits I make scripts for AHKv2 (my v2 compiler) & WIN_7+ Spanish Argentina
(If any of my code written for v2 has stopped working, send me a private message. I appreciate that you correct my English.)

Return to “Ask For Help”

Who is online

Users browsing this forum: bluetruesky, evilC, jNizM, kadhri, mrlegacy83, SOTE and 33 guests