I am trying to ensure that a program on our server, AGS, is closed before processing another instance of AGS. The trouble is, if it is logged in I can close it no problem (ALT + fx), but if it is only at the login screen - I just need to focus on it and Press ESC or Cancel. But this window does not have a title bar, nor does it have a title. How does one set focus to a window that has no title name?
There could be many instances of this open, so I would like a short loop to focus each Login screen and close it one by one.
Using Tools > Open Windows, I have discovered which window ID relates to the AGS windows open (i opened 5 instances and looked for duplicates, then right clicked > Show Window and it came to front). The details listed under Open Windows are as follows:
As you can see, the Window is FNWNS390 "". Now without a description, one cannot use the 'SetFocus>' command to link to it. I'm assuming that FNWNS390 is the ClassName? Therefore, is it possible to SetFocus or similar to a window by using the ClassName? I can't use the PID as the process number will change for each instance and will never be the same on different days.+263270 - FNWNS390 ""
- 656432 - Button "Build 20050309"
- 656478 - Button "V10.0"
- 197922 - Button "&OK"
- 328944 - Button "Cancel"
- 197936 - Button ""
- 721954 - Button ""
- 263342 - Button ""
- 263340 - Button "This computer program is the property of SAGEM SA. Use, examination, copying, transfer and disclosure to others, in whole or in part, are prohibited except with the prior
written consent of SAGEM SA."
- 394450 - Button "Password"
- 328948 - Button "Login Name"
- 722018 - Edit ""
- 721970 - Edit "AUTO"
- 721980 - Button ""
I created some code to get details from the program, I have included it below so you can understand the situation further:
GetActiveWindow>title,x,y
GetWindowHandle>%title%,handle
GetWindowProcess>%title%,pid,pname
MessageModal>Title: %title% - Handle: %handle% - Process ID: %pid% - Process Name: %pname%
On Macro Scheduler Window, Returns:
On AGS Login Window, Returns:Title: Macro Scheduler 8.0 beta 007 - Handle: 3277072 - Process ID: 4088 - Process Name: C:\Program Files\MJT Net Ltd\Macro Scheduler\msched.exe
I am using the new Beta v.8.0.Title: - Handle: 0 - Process ID: 0 - Process Name:
GetControlText uses the ClassName feature, but I don't think that this will do anything like what I need?!
Please can you help me? I'm stumped for ideas now!