Lock computer key

Get help with using AutoHotkey and its commands and hotkeys
JoPo
Posts: 25
Joined: 04 Feb 2018, 09:03

Lock computer key

18 Jun 2018, 11:01

Hi !

I've got this new keyboard which has a dedicated key to lock the computer, then retype password, etc.

I made a script when I use an application to help me to control it just with the keyboard. I'm in the dark because I use a projector to show to an audience. But when I, accidently, hit the 'lock pc' key, it locks itself ! And I look a bit like an idiot.. :mrgreen: This special key is not seen when I use the GeSHi script (http://qbnz.com/highlighter/), nothing appears but the pc locks !

So I added to my script :

Code: Select all

run E:\Souk_fast\Autohotkey\Windows Lock Workstation Hacks\Disable Lock Workstation Functionality.reg
in order to prevent the pc to lock. And it works pretty well, just have to click on 'yes' on the confirmation message that appears, then on 'ok' (if someone knows how to avoid thart, it would be awesome !)

Now, what I'd like (and apparently not able to achieve) is to run "Enable Lock Workstation Functionality.reg" when I close the script cause I need to lock the computer ! I've found the "OnExit" code but after several tries, I must admit that I don't know how to use it...

So I need help ! Thanks a lot !
> > > > > > > > > > > > --- Musica --> here ! ---< < < < < < < < < < < <
coffee
Posts: 111
Joined: 01 Apr 2017, 07:55

Re: Lock computer key

18 Jun 2018, 11:32

JoPo wrote:Hi !

I've got this new keyboard which has a dedicated key to lock the computer, then retype password, etc.

I made a script when I use an application to help me to control it just with the keyboard. I'm in the dark because I use a projector to show to an audience. But when I, accidently, hit the 'lock pc' key, it locks itself ! And I look a bit like an idiot.. :mrgreen: This special key is not seen when I use the GeSHi script (http://qbnz.com/highlighter/), nothing appears but the pc locks !

So I added to my script :

Code: Select all

run E:\Souk_fast\Autohotkey\Windows Lock Workstation Hacks\Disable Lock Workstation Functionality.reg
in order to prevent the pc to lock. And it works pretty well, just have to click on 'yes' on the confirmation message that appears, then on 'ok' (if someone knows how to avoid thart, it would be awesome !)

Now, what I'd like (and apparently not able to achieve) is to run "Enable Lock Workstation Functionality.reg" when I close the script cause I need to lock the computer ! I've found the "OnExit" code but after several tries, I must admit that I don't know how to use it...

So I need help ! Thanks a lot !

Code: Select all

EnableLock() ; Since you are on v1
{
	run E:\Souk_fast\Autohotkey\Windows Lock Workstation Hacks\Disable Lock Workstation Functionality.reg
}

OnExit("EnableLock")

; If using just the function name doesn't work, try OnExit(Func("EnableLock"))

just have to click on 'yes' on the confirmation message that appears, then on 'ok' (if someone knows how to avoid thart, it would be awesome !)
You can just use the registry commands/functions of autohotkey to flip the registry values yourself instead of importing a file.
JoPo
Posts: 25
Joined: 04 Feb 2018, 09:03

Re: Lock computer key

19 Jun 2018, 15:12

Thank you ! Sorry, impossible to come here sooner. I don't get very well the script you give me. It doesn't work, anyway.

I'd like to enable lock workstation on script exit. I'm lost ! I must say that your script doesn't help me much to understand. :oops: But the registry commands/functions of autohotkey to flip the registry looks very promising ! How ? Where ? :mrgreen:

Thank you !
> > > > > > > > > > > > --- Musica --> here ! ---< < < < < < < < < < < <
JoPo
Posts: 25
Joined: 04 Feb 2018, 09:03

Re: Lock computer key

21 Jun 2018, 06:03

I must bring this thread back up because I'm completly lost... And I'd really like to have a solution. It's not that easy to learn autohotkey scripting by myself ! But I'm strongly motived, I wish I make scripts alone, and I do some, but sometimes, it's impossible without someone who give me a hand.

What ever I try with 'OnExit', it doesn't work ! :-? :crazy:

Thanks for any help / info !
> > > > > > > > > > > > --- Musica --> here ! ---< < < < < < < < < < < <

Return to “Ask For Help”

Who is online

Users browsing this forum: asad41163, BreezeB, kentpachi, malcev, RogerWilcoNL, Zudegia, zvit and 204 guests