From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send keyboard commands to another windows program

I am attaching the SendKey VIs I downloaded from somewhere -- can't remember where from.  There's a Sendkey.txt file in the Zip that you will want to read, and maybe send a 'Thank you' email to the author. 

-Khalid

0 Kudos
Message 11 of 17
(5,183 Views)

Roy,

 

Here are some "code snipplets". It shows the API's interfaces, but nothing more.

 

Sending the WM_KEYDOWN and WM_KEYUP message is tricky, but once you've got it down, it should work fine. You'll find the documentation in MS's MSDN.

 

Hope it help.

 

Wiebe.

Message 12 of 17
(5,184 Views)

Thanks Wiebe and Khalid. I got it working with keybd_event. But Wiebe's SendMessage seems to be very elegant. I will try that out.

 

Thanks again.

~Roy

0 Kudos
Message 13 of 17
(5,167 Views)
See the attached VI's. I used the keybd_event function to generate keyboard output from LabVIEW. These VI'sare best suited for touchscreen applications, and a resolution of 1280 X 1024. If you want to use them as subVI's, you can wire the reference to the desired string control from the calling VI. The virtual keyboard will pass its output to this string control. The string control from the calling VI is kept in focus by the keyboard VI. If you use it as a stand alone VI, you don't have to pass the string reference.
0 Kudos
Message 14 of 17
(5,158 Views)

@Ed007 wrote:
These VI'sare best suited for touchscreen applications, and a resolution of 1280 X 1024...  The string control from the calling VI is kept in focus by the keyboard VI.
That sounds exactly like something I want to do (creating a keyboard which will function like the windows OSK), but didn't get around to looking into yet.
 
Unfortunately, I can't open it. Can you backsave the VIs to 7 or 7.1? Thanks.

___________________
Try to take over the world!
0 Kudos
Message 15 of 17
(5,133 Views)
OK, try this one. I backsaved to Version 7.1.
Message 16 of 17
(5,127 Views)
Yes, this might help as a basis for some applications, even though it doesn't do a real simulation of the windows OSK. Thanks.

___________________
Try to take over the world!
0 Kudos
Message 17 of 17
(5,102 Views)