Hi All,
Firstly, Thanks to AutoIt, we have implemented automated solution in our project using AutoIt. This tool is wonderful.
This is my first post and would be happy to get a solution for the follwoing issue.
We have multiple instances of the same application running when running the AutoIt script. The control will normally be in one window and this will switch between other instance(window) of the application if required. We have used Handles to identify the correct window and through out our script, handle is used for any action(Example: Sending text using controlsend).
The problem is when one instance of the application window is running the other instance of the window may get session timed out, so we want to send some dummy text to the other instance window at particular time intervals. We cannot use the main script to do this job. So we are planning to store the opened instance window's handles in a text file, then read the same using a separate script file and then sending the dummy text. The separate script can be triggered manually after triggering the main script.
Please see the below code,
Opt("SendKeyDelay", 20)
Opt("SendKeyDownDelay", 50)
Opt("WinTitleMatchMode", 4)
$handle = "0x000905DA"
WinActivate("$handle")
for $i =1 to 100
;ControlSend("Untitled - Notepad", "", "Edit1", "dummy text")
ControlSend("$handle", "", "", "dummy text")
Next
Here, I can able to successfully activate the correct window. When using this line of code
ControlSend("Untitled - Notepad", "", "Edit1", "dummy text")
this is perfectly working as I expected.
But when I use the following line of code
ControlSend("$handle", "", "", "dummy text")
this is not working as expected. I wonder that in my main automation file, I have through out used similar to this line of code to send the text(Using handles), but not working now.
The only difference is that in my main automation file, I trigger the application from the script itself and I get the handle. Here, the application(notepad.exe) is already running and using AutoIt WIndow Info tool I get the window handle and directly using it.
I have also tried using the exact control handle of edit control in the notepad but still no use.
Please can anyone help me out in this issue?
Thanks,
Karthik