| View previous topic :: View next topic |
| Author |
Message |
Jasdeep
Joined: 09 Nov 2009 Posts: 258
|
Posted: Mon Feb 08, 2010 9:13 am Post subject: how my ahk tool would recognize that a process has finished? |
|
|
Hi everyone…is there a way to know whether an application has finished its task??
I have developed a gui tool in ahk and I am controlling a tool which is meant for testing applications. My task is to upload some tests in to that testing tool and make the tool to execute all one by one. What I did is I created a .ini file and asked the user to provide the paths of all the test he wants to execute. So my plan is like when the testing tool finishes one test then my ahk tool reads the next test path from the .ini file and place that path into the edit field of the testing tool from where the testing reads and carries out the test.The problem is once when the testing tool finishes one test it does not pops up any message like “process finished” or something similar to this. So how would my ahk tool will recognize that the test has been finished so that it start to reads from the .ini file and upload the next test into the tool??? While the test is going on the testing tool only opens a text window (Log-Panel) where the results are displayed continuously and once finished the text window remains as it is. So how would my ahk tool would know that the test has been finished so that I can upload next test.
thanks for reading my problem...any help would be greatly appreciated |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Mon Feb 08, 2010 9:19 am Post subject: |
|
|
Can you use controlgettext to read text from that window? If so you could use a settimer that would check the text every minute or so and if the text hasn't changed 2 times in a row assume it is finished and proceed with the next test? _________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
Jasdeep
Joined: 09 Nov 2009 Posts: 258
|
Posted: Mon Feb 08, 2010 9:39 am Post subject: |
|
|
| thanks hugov but controlgettext doesnt works in my case because under the windows spy utility its not giving any classname or visible window text...when i try to display the text its blank |
|
| Back to top |
|
 |
Jasdeep
Joined: 09 Nov 2009 Posts: 258
|
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Mon Feb 08, 2010 9:44 am Post subject: |
|
|
take screenshots of the window and compare images (search the forum don't ask for someone to make it for you, the code is already available somewhere) _________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
Jasdeep
Joined: 09 Nov 2009 Posts: 258
|
Posted: Mon Feb 08, 2010 9:48 am Post subject: |
|
|
| well i am not sure but comparing images also compares the text inside it???? |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Mon Feb 08, 2010 9:52 am Post subject: |
|
|
why don't you try? if the text doesn't change the window is the same isn't it? you can make screenshots of a specific area/window - again search the forum. _________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
Jasdeep
Joined: 09 Nov 2009 Posts: 258
|
Posted: Mon Feb 08, 2010 9:59 am Post subject: |
|
|
| well i tried but it doesnt checks the contents of the window that means always errorlevel of 1 anyways thanks for your help |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
|
| Back to top |
|
 |
Jasdeep
Joined: 09 Nov 2009 Posts: 258
|
Posted: Mon Feb 08, 2010 10:11 am Post subject: |
|
|
well i tried well and the contents of the image are not compared no matter you write anything inside the window only the window title,bar are compared but not what is written inside
| Code: |
WinWaitActive Untitled - Notepad
WinGetActiveStats, Title, Width, Height, X, Y
sleep 2000
ImageSearch, OutputVarX, OutputVarY, 5,0 , Width, Height, *255 untitled.bmp
if (errorlevel<>0)
{
msgbox ErrorLevel was %ErrorLevel% `nErrorLevel is set to 0 if the image was found in the specified region, 1 if it was not found
, or 2 if there was a problem that prevented the command from conducting the search (such as failure
. to open the image file or a badly formatted option). `n`n press OK to continue.
}
else
{
msgbox image found
}
Return
|
in the above image i have written something and saved. but when i open notepad without any text still it says that image found...so??? |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
|
| Back to top |
|
 |
Jasdeep
Joined: 09 Nov 2009 Posts: 258
|
Posted: Mon Feb 08, 2010 10:16 am Post subject: |
|
|
| without *255 you cant even detect the notepad window so it has to be mentioned |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Mon Feb 08, 2010 10:27 am Post subject: |
|
|
Why don't you read the documentation again. What are the width & height doing in your search for the X2 and Y2 position? This is the last I'll post about this. _________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
Jasdeep
Joined: 09 Nov 2009 Posts: 258
|
Posted: Thu Feb 11, 2010 4:07 pm Post subject: |
|
|
| ok buddy...but finally i made it working one thing i realised that bigger the area of search longer the time it takes to search and also the images are very sensitive slight diversion leads to error well thanks for all your help and i hope next time your temper doesnt gets heated |
|
| Back to top |
|
 |
|