LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement keyboard activation of executable?

I tried to code a program which can be activated by key board. That is when it is minized or hidden behind other programs, it can be activated and brought to the top of all programs by clicking on the key board. 

 

I don't know how to implement this though. Event structure won't work here because the front panel is not activated. The puzzle here is how to code a LV program which monitors the key board all time. 

0 Kudos
Message 1 of 3
(2,399 Views)

LabVIEW has keyboard VIs (search the palettes) which work even when there's no focus. The catch is that you have to poll the keyboard.

 

As for bringing a window to the front, you can get a handle to the window and set its position using Windows API calls. If you search for "winutil" or "Windows API" here, you should be able to find VIs which make these calls. If not, there are quite a few examples. Search for "SetWindowPos".


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,396 Views)

Thanks. I found those VIs. I kept thinking the keyboard clicking as an event, that's why I could not jump out of the event structure box. Thanks again. 

0 Kudos
Message 3 of 3
(2,386 Views)