Jump to content

karthik001

Members
  • Posts

    5
  • Joined

  • Last visited

karthik001's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. The solution from CityOfNashua worked for me. Great and Thanks !!!!
  2. Thank you very much bogQ. Unlike notepad window, my application window allows to send data without focus, so no further problem. Appreciate your help. Thanks, Karthik
  3. Thanks bogQ. I tried as per your suggestion. That works like charm. Please see below lines of code: $handle = "0x001A0646" $var = WinList() For $i = 1 to $var[0][0] If $var[$i][1] = $handle Then $handle = $var[$i][1] EndIf Next WinActivate($handle) for $i =1 to 100 ;ControlSend("Untitled - Notepad", "", "Edit1", "dummy text") ControlSend($handle, "", "", "dummy text") Next However is it possible to send dummy text without activating the window i.e., without bringing the window to foreground? When I use the following line of code ControlSend("Untitled - Notepad", "", "Edit1", "dummy text") this is working even though without using the code line - WinActivate($handle) But when I use the following line of code ControlSend($handle, "", "", "dummy text") text is send only when the window is in foreground or I have to use the code line - WinActivate($handle) Regards, Karthik
  4. Thanks icode and bogQ for the replies. I have changed the code to following, but still this is not working. $handle = "0x00020616" ;This I have taken using AutoIt WIndow Info tool WinActivate($handle) for $i =1 to 100 ;ControlSend("Untitled - Notepad", "", "Edit1", "dummy text") ControlSend($handle, "", "", "dummy text") Next For testing purpose, I have opened a notepad window, then directly got the window handle using AutoIt WIndow Info tool and used the same in code. Anyhow in reality, this is not going to happen. But as I explained in my earlier post, the handles of the windows will be identified by different .au3 script, I will save these handles in a file. I know how to identify the handle of the windows but in the main script I cannot send dummy text as it is designed for some other purpose. I will trigger another.au3 script which will read the handles from the already saved file and will send some dummy text to those windows at regular intervals to keep the session active. Regards, Karthik
  5. 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
×
×
  • Create New...