LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

send data windows application

Hi,
 
Labview :- 8.2 Full Developement System
OS :- Windows XP
 
I want to launch a application from labview (which I already did), it is a exe program and has some menu items. I want to launch this application from my Labview Application and programatically click the menu items on (Basically automate the clicking of different menu buttons available in this particular application). How can I achieve this. I guess I have to make calls to Win32.DLL or User32.DLL functions etc.
 
Thanks.
 
Kam
0 Kudos
Message 1 of 5
(3,050 Views)
Yes you are right.

You will have to use the win API calls to get handles to the windows and controls that you want to manipulate. Its not trivial, you might have to do some reverse engineering to understand the message handler of the application and to which windows messages the controls you want to manipulate react. Doing this could easily crash you PC and most certainly LV more than once. Timing is very important too, because programmatically posting windows messages is a lot faster than the user could press. Applications GUIs are build to react to users (relatively slow interaction), therefore this has to be mimiced as well.

I cannot help you is further detail, but I know it is doable, because we have done it aswell.


Message Edited by andre.buurman@carya on 11-27-2007 10:52 AM
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 5
(3,034 Views)

Andre,

IMO, he can use the Event Structures to automate the programmatical clicking of menu items by the user. No need for Win API calls...

Or am I not getting the point?

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 3 of 5
(3,024 Views)

Hi guys,

Thanks for the quick response. Is there a example to make such calls to windows APIs. I have worked with Win API's like getting and setting mouse cursor position etc. (micky mouse stuff). The thing I want to achieve is that the Window application that I want to interact is not a LAbview window rather it is a separate application and has menu's and buttons. I guess can not use Labview Events. As these events are happening in the OTHER window.

I will appreciate that if you guys can send me a link to some examples or something. I really appreciate the help that I am getting from you guys.

 

Thanks.

 

Kam

0 Kudos
Message 4 of 5
(3,016 Views)
Hi Kam,

I'm sure it will end up being quite an involved project to do what you are proposing, but hopefully with some perseverence and good knowledge of the windows libraries you can get it working.

Here are a couple examples which you might find useful for getting started with making calls to user32.dll:
http://zone.ni.com/devzone/cda/epd/p/id/3711
http://zone.ni.com/devzone/cda/epd/p/id/1509

Open up the call library nodes in the examples and see you to configure calls to the functions and wire inputs and outputs to it.

You can find the MSDN library here:
http://msdn2.microsoft.com/en-us/default.aspx
http://msdn2.microsoft.com/en-us/library/ms646304.aspx (function used to synthesize keyboard events used in the second example above).

Good luck with your application!

0 Kudos
Message 5 of 5
(3,002 Views)