To give you some background, i'm attempting to run several instances of a program (10 to be exact). Once opened, each open session begins it's own automatic process and is then minimised to the system tray, once it has completed it's process it then automatically closes itself. In order to capture when each program closes, i'm monitoring window handles instead of window titles (as they all have the same title).
So i've set
Code: Select all
Set>WIN_USEHANDLE=1
Code: Select all
ExecuteFile>Program1
WaitReady>0
Wait>delay
Code: Select all
GetActiveWindow>Program1,x1,y1
The way i decided to do this was to use the x,y coords pulled from GetActiveWindow and verify it against GetWindowPos.... so -
Code: Select all
Label>Program1Open
Wait>delay
GetWindowPos>%Program1%,x1a,y1a
If>{(%x1% = %x1a%) AND (%y1% = %y1a%)}
Goto>Program1open
Else
Goto>Program2
Endif
The problem i'm running into though is that once the window is minimised to systray, GetWindowPos still returns the same co-ordinates as when the program was initially opened.
Am i doing something wrong? Or is there a simpler way for me to figure out when the first window has minimised so that the script can proceeed onto launching the 2nd then the 3rd program etc. etc.
Any suggestions or pointers appreciated.
Cheers