Lock computer when a device is disconnected

Get help with using AutoHotkey and its commands and hotkeys
User avatar
chenhoulin6204
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
Flipeador
Posts: 1019
Joined: 15 Nov 2014, 21:31
GitHub: Flipeador
Location: Argentina
Contact:

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 SublimeText 3 & AHKv2 My GDI+ Library

Return to “Ask For Help”

Who is online

Users browsing this forum: billy, chill8888, Elaphe666, gecko, pilgrim333, swagfag, wellmedemployee, Xtra and 68 guests