05-23-2019 09:13 AM
Hi,
How can I detect the when the user hits the Windows key?
The "Key Down" event doesn't detect this key.
- Sable
Solved! Go to Solution.
05-23-2019 11:58 AM
I'd try out 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).
05-23-2019 07:20 PM
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
05-23-2019 10:14 PM
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).
Just unzip the attachment, open the VI and make sure it finds the dll parked next door in the same directory.
05-24-2019 01:14 AM
Interesting.
Could you please help to save the vi in LabVIEW 2013?
05-24-2019 08:51 AM
Added LV2013 version to the zip archive.
05-24-2019 11:43 AM
Thank you very much Darin.K.
05-25-2019 11:14 AM
You should mark Darin's post as the solution. Not your own thank you message.