ITMan2001 Posted August 10, 2018 Share Posted August 10, 2018 Hello, I have an application that does not have a top tool bar drop down menu with an EXIT (close the program) option, the proper way to close the program is by clicking on the red X in the upper right of the window. The program can have 1 or may windows open, each of those windows are closed one by one (by clicking on the red X in the upper right) until no more windows are open, at this point the program is closed. Can AUTOIT automatically close that program whether it has 1 or many windows open after a certain amount of inactivity? Not sure AUTOIT can create a scrip that will accomplish this. The script should simulate clicking on the red X on each window until no more windows from that program are left open. Please help Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted August 10, 2018 Share Posted August 10, 2018 Hi @ITMan2001 Take a look at Au3Info tool, and Control* functions Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Danp2 Posted August 10, 2018 Share Posted August 10, 2018 Also look at ProcessClose in the help file. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted August 10, 2018 Share Posted August 10, 2018 WinList() and go through the list WinClose() anything with a title pattern would be one way to simulate closing each window. If it will not cause issues, you can just kill the whole process like Danp2 mentioned. Link to comment Share on other sites More sharing options...
ITMan2001 Posted August 10, 2018 Author Share Posted August 10, 2018 Thanks guys, I am not looking to close (terminate) the process the way Task manager would. Replicating clicking on the red X in upper right would be best Link to comment Share on other sites More sharing options...
Earthshine Posted August 10, 2018 Share Posted August 10, 2018 did you do what @FrancescoDiMuro suggested? FrancescoDiMuro 1 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
jdelaney Posted August 10, 2018 Share Posted August 10, 2018 (edited) Use winclose on the main window. That does the same functionality as pressing the x on the window. Example, open notepad, enter in text, processclose on the process: process closes without going through the softwares exit processes (prompt user to save changes is not present) Do the same with winclose...user IS prompted to save changes (just like if the x was passed) Edited August 10, 2018 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
ITMan2001 Posted August 20, 2018 Author Share Posted August 20, 2018 Hello Experts WinCLose works great, just one issue......sometimes when WinClose is applied the window being closed asks if you want to "save changes", I am then presented with 2 options, yes/no. Is there a way to configure the script so that if a follow pop up window shows up after WinClose, "yes" is selected? Link to comment Share on other sites More sharing options...
Danp2 Posted August 20, 2018 Share Posted August 20, 2018 Yes... Use WinExist to check for the "save changes" dialog, then take the appropriate actions if found. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now