LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable the windows key?

Solved!
Go to solution

Hi,

 

How can I detect the when the user hits the Windows key?

The "Key Down" event doesn't detect this key.

 

- Sable

0 Kudos
Message 1 of 8
(3,622 Views)

I'd try out WinKill

https://casey.io/winkill/

 

You can use the dll to attach and detach the hook which blocks the windows key.  (If I recall correctly, it blocks for all applications, not just the one you attach the blocker to).  

0 Kudos
Message 2 of 8
(3,591 Views)

Thank you Darin.K.

 

Can you show me how to do this with a .dll to attach and detach the hook?

 

I am also looking for a way to detect when the user hits the Windows key on the keyboard.

 

- Sable

0 Kudos
Message 3 of 8
(3,558 Views)

Quick example to show the WinKill usage.  I have adapted the code a little to remove the name mangling and to post a user event back to LV.  The windows callback function does not provide for user data so I had to get ugly and use a dll global variable.  The idea is simple:  create the hook and the user event,  do stuff (while loop), then remove the hook after the application is done.  Note, this disables the Windows keys for other applications, although you can still detect the presses (left or right).

 

WinKillBD.png

 

Just unzip the attachment, open the VI and make sure it finds the dll parked next door in the same directory.

Message 4 of 8
(3,548 Views)

Interesting.

Could you please help to save the vi in LabVIEW 2013?

0 Kudos
Message 5 of 8
(3,537 Views)
Solution
Accepted by topic author Sable

Added LV2013 version to the zip archive.

Message 6 of 8
(3,514 Views)

Thank you very much Darin.K.

0 Kudos
Message 7 of 8
(3,501 Views)

You should mark Darin's post as the solution.  Not your own thank you message.

 

0 Kudos
Message 8 of 8
(3,474 Views)