01-17-2014 09:38 AM
Hi.
I have some days working on an HTA application. I want to control it throught LabVIEW.
There are possible solutions:
1) This one worked but Im not satisfied: The approach I used is to modify a bit the code, javascript and HTML. Then open it and controlling the button events with my LabVIEW VI. I used this approach in the past with other applications with success.
But for some reason functions from User32.dll does not work for this application, for example if I list the opened windows, the hta application is not visible.
So i did some tricks to make the window active, added "ALT + letter" shortcuts to each button i need to use, so I can control it on that way. If the hta is updated, i need to do some changes to the code.
2) Calling external Javascript (http://lavag.org/files/file/59-calling-external-javascript/)
My tests here didnt worked. I need to delete all HTML code from the HTA and do some replacements to read the script file. But when i call fucntions i had errors that I cant fix.
3) ActiveX web browser (http://forums.ni.com/t5/LabVIEW/Error-when-trying-to-call-Javascript-function-in-ActiveX-Web/m-p/180...)
There are errors when loading the hta (renamed as htm to open it here). I tried to load the original hta as htm, and also the modified hta file, but got same errors.
Question is:
¿Can someone recommend another way to do this?
Also if someone knows how to make work user32.dll functions with this application, would be realy useful.
01-17-2014 10:50 AM
01-17-2014 02:30 PM
Thanks by your response.
Let me investigate about it, never heard about Autolt before. I will post my results here.
01-17-2014 02:37 PM
01-31-2014 10:22 AM - edited 01-31-2014 10:23 AM
Problem here is that i dont know a way to get the hta application window handle. I did research in google but didnt find someone that know how to do this.
So I dont have a way to use it with user32.dll or AutoIt.
Thanks by your help, I didnt knew about AutoIt so this helped me to learn something new.
My solution was to do some changes to the hta file. Then replace files path in the code, open it in LabVIEW and add task automatically by code.
When the HTA finished and labview need to do some actions, what i did is change the hta window name. LabVIEW is waiting for this, so when it found the waited name, do some actions and then give control again to HTA using keyboard event. Then the hta close it itself.