Jump to content

Is it possible to control applications run in windows XP from LabView,


Recommended Posts

Question: Is it possible to control applications run in windows XP from LabView, by emulating buttons clicks, reading visible text etc.. is it at all possible? I have our own C++ application used in embedded testing, instead of rewriting all functionality in LabView wanted to use originally created C++ application by hooking to Windows API and simulating buttons clicks driven by LabView as well as reading data from this C++ application (by LabView). Please help. Thank you,Alex[/size]

Link to post

QUOTE (Omar Mussa @ Jul 21 2008, 07:24 PM)

I seen this NI.com article before..

I am looking for actual VI examples..

Used QTP to automate my testing before (same idea of using 3rd party applications to do the actual testing and all controlled from QTP).. Now trying to convert to using LabView and interfacing with 3rd party C++ applications by faking user actions (clicks/keyboard) is critical.

Looking for examples..

Thank you!

Link to post

QUOTE (iowa @ Jul 21 2008, 05:06 PM)

I also use Auto It and love it. Mostly because it has Active X Drivers which make it work well with LabVIEW. I am planning to submit my AutoIt Vis to the CR sometime this year. I like the Idea of using the windows calculator as a demo example.

I have posted my Win API set of keyboard emulation vis Here. There might also be some useful info Here.

If you do come up with a usable set of Windows API vis please post them or put them in the CR. I know that many members would appreciate a good Windows API library.

Link to post

QUOTE (mballa @ Jul 22 2008, 04:50 AM)

I also use Auto It and love it. Mostly because it has Active X Drivers which make it work well with LabVIEW. I am planning to submit my AutoIt Vis to the CR sometime this year. I like the Idea of using the windows calculator as a demo example.

I have posted my Win API set of keyboard emulation vis Here

. There might also be some useful info Here.

If you do come up with a usable set of Windows API vis please post them or put them in the CR. I know that many members would appreciate a good Windows API library.

Found this:

Windows API Function Utilities (32-bit) for LabVIEW[/size]http://zone.ni.com/devzone/cda/epd/p/id/4935 These VIs make calls to the Windows Application Programming Interface (API) for managing and controlling windows (minimize, maximize, move, resize, rename, close, etc); managing applications (run application, quit application, print file, etc); adding and removing network resources; keyboard filtering; and system utilities (mouse cursor position, windows path, screen resolution, system path, etc). These VIs are intended for use only on 32-bit Windows platforms.

And this:

Thanks,

Alex

[/size]

Link to post

QUOTE (iowa @ Jul 23 2008, 11:54 AM)

I could really use working VI example which uses Windows API to control Windows Calculator..

Its really unlikely that anyone is going to have the time or interest in building an example that controls the Windows Calculator... However if you feel it is worth your time to do this and post the resulting VI(s) to this thread, then other people will very likely look at your code and try to tell you how to improve it.

Link to post
  • 2 weeks later...

QUOTE (westjlittle @ Jul 31 2008, 10:16 PM)

Some of these actions can be done by using a GUI test program like TestComplete. We use it to verify our software products

Jim

The question was HOW to interact with 3rd party application's Front-End GUI directly from LabView (from VI file) by the use of Windows API..

TestComplete is another test automation tool similar to AutoIt or QTP..

This is not what I was looking for...

Link to post

QUOTE (iowa @ Jul 31 2008, 03:22 PM)

The question was HOW to interact with 3rd party application's Front-End GUI directly from LabView (from VI file) by the use of Windows API..

TestComplete is another test automation tool similar to AutoIt or QTP..

This is not what I was looking for...

Is there some reason you have to do all the Windows API work yourself? I thought the suggestion of using compiled AutoIt scripts was quite nice. AutoIt does all the API work and you just run the exe from your VI. Is there a reason this doesn't work for you?

Link to post

QUOTE (JDave @ Jul 31 2008, 10:45 PM)

Is there some reason you have to do all the Windows API work yourself? I thought the suggestion of using compiled AutoIt scripts was quite nice. AutoIt does all the API work and you just run the exe from your VI. Is there a reason this doesn't work for you?

Yes there is a reason..

The LabView project I work with executes millions of the software / hardware tests and adding Windows API interfacing ability to "hook" into another 3rd party (C++) application will let me enhance already existing test coverage by reusing another application's functionality... Using AutoIt will not be as elegant or as fast because of the big number of buttons I will have to interact with ... expect on average to click 1-3 million of buttons every 24 hours.. Direct interfacing from LabView by the use of Windows API will let me do it directly and faster without the need for huge library of AutoIt executables.

BTW -- found some working Windows API examples on NI.com (library of VIs for opening applications, resizing, moving, clicking etc..)

Link to post

QUOTE (iowa @ Jul 21 2008, 06:06 PM)

I tried it already BUT it is balky and consumes run time.

I would like to have more elegant solution of using Windows API to emulate Clicks/Keyboard thus driving C++ test application directly from LabView.

Still hope for Simple LabView WinAPI Example: such as code example of working with Calculator from LabView..

I'm doubt you find it. Automating user interface testing on a Windows API level is absolutely not trivial (hence contradicts your requirement of simple LabVIEW examples) and is the reason there exist software packages like AutoIt.

If you really hope to build an extensive UI testing framework for non-LabVIEW applications don't go and try to use LabVIEW for it. Of course it can be done as there is virtually nothing that couldn't be done in LabVIEW if it can be done in a program at all, but it is going to be a major pain in the ######. Feel free to research the Windows API on MSDN and proof me wrong but asking for simple examples here is not likely to give you anything useful.

Rolf Kalbermatter

Link to post

QUOTE (rolfk @ Aug 1 2008, 09:19 AM)

I'm doubt you find it. Automating user interface testing on a Windows API level is absolutely not trivial (hence contradicts your requirement of simple LabVIEW examples) and is the reason there exist software packages like AutoIt.

If you really hope to build an extensive UI testing framework for non-LabVIEW applications don't go and try to use LabVIEW for it. Of course it can be done as there is virtually nothing that couldn't be done in LabVIEW if it can be done in a program at all, but it is going to be a major pain in the ######. Feel free to research the Windows API on MSDN and proof me wrong but asking for simple examples here is not likely to give you anything useful.

Rolf Kalbermatter

As posted before, already found some of the basic Windows API examples from NI.com.

The AutoIt is useless when someone have to deal with 100s of different interactions... would you really prefer to fire array of 100s of executables created in AutoIt instead of robust LLB with VIs using actual Windows API "hooks" controlling 3rd party application?

As for not using LabView statement:

In scope of any complex LabView implementation there is a BIG benefit from using 3rd party applications to supplement LabView coverage. In my case I implemented hooks into 3rd party GUI and it is working.. not perfect but working.. When time permits will be expanding my LLB by adding new "hooks".

Thanks to all who responded to my questions with actual answers & ideas. It helped to get started on this.

Link to post

QUOTE (iowa @ Aug 1 2008, 09:19 AM)

Exe scripts are not the only way to use AutoIT!!! If you look on their webpage.

it says they have DLL and COM (ActiveX) control.

post-584-1217618431.png?width=400

After AutoIT is installed you can access the functions using the Active-X Open and Invoke nodes

Here is how to use AutoIT in LabVIEW

Here are some vis to get you started.

Download File:post-584-1217621205.zip

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.