From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Does LabView have a function similar to 'SendInput()' from C++?

I'm trying to incorporate a string or strings  to the keyboard input stream to enter some data to an application already running (I can not transfer any data to this application since I only have the  .exe file).

As far as I know, there is a function in C++,  SendInput(), that can do this.  

http://msdn.microsoft.com/en-us/library/ms646310.aspx

Is there any similar function in LabView?

Thx a lot.

0 Kudos
Message 1 of 6
(6,176 Views)
That's a Windows API function, so in order to call it from LabVIEW you need to use the Call Library Function Node function under Connectivity -> Libraries & Executables. Search these forums for "SendInput", as this has come up before.
0 Kudos
Message 2 of 6
(6,171 Views)

Thx for the info, I'll into that and I guess this can be completed soon. 

Thx again.

0 Kudos
Message 3 of 6
(6,168 Views)

Hi Folks,

      I saw this post when it was new and, since then, have been fighting to get SendInput.to work - finally finding the solution on the LAVA forum.  It didn't seem easy to find an example of SendInput or keybd_event, here, so for future NI-LabVIEW forum users, here's an example that shows 3 ways to inject keystrokes - including a very simple .NET method "Windows.System.Forms.SendKeys.SendWait".

 

Cheers Smiley Happy

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 4 of 6
(6,128 Views)

Hi, tbd!

Good example, but it won't work in LabVIEW 64-bit. To get it working you will need to alter the code according to these recommendations.

0 Kudos
Message 5 of 6
(4,133 Views)

hey thanks for the example but i am looking to use sendinput dll to send mouse right click command as mouse event dll is suppressed in the windows 10 . so can you please guide me so as to how to achieve it

🙂 

0 Kudos
Message 6 of 6
(2,988 Views)