fRequEnCy Posted September 28, 2008 Share Posted September 28, 2008 (edited) I have a problem and hoping someone has a solution. I have a script that runs another app. Now when the app closes then the script closes just fine using ProcessWaitClose(). Example: $PID = Run("app.exe") ProcessWaitClose($PID) Exit But what I'm wanting is a way to close the app if the script process is forced to close like in Task Manager. Now I've successfully done this using another script (kill_child) making sure everything closes cleanly. Script kill_child is called and makes sure everything is closed the way I'm wanting. Example: $PID = Run("app.exe") run("kill_child.exe") ProcessWaitClose($PID) Exit I've played with OnAutoItExit() and it works somewhat that if the script is closed then the app is closed. But OnAutoItExit() doesn't work when process of script is forced to close. Any ideas other than what I'm currently doing to accomplish this with just one script? Edited September 29, 2008 by fRequEnCy Link to comment Share on other sites More sharing options...
fRequEnCy Posted September 29, 2008 Author Share Posted September 29, 2008 bump and changed title for better understanding. Any help would be appreciated. Link to comment Share on other sites More sharing options...
rasim Posted September 29, 2008 Share Posted September 29, 2008 bump and changed title for better understanding. Any help would be appreciated.Great example from SmOke_N Link to comment Share on other sites More sharing options...
fRequEnCy Posted October 2, 2008 Author Share Posted October 2, 2008 Thanks for the example but didn't understand how to close the child window if parent window is forced to close. Link to comment Share on other sites More sharing options...
rasim Posted October 2, 2008 Share Posted October 2, 2008 Thanks for the example but didn't understand how to close the child window if parent window is forced to close.You can close the child window in next program starting. Link to comment Share on other sites More sharing options...
fRequEnCy Posted October 2, 2008 Author Share Posted October 2, 2008 You can close the child window in next program starting.True but then I have to rely on running the next program just to do it. I'll stick with my kill_child script for the time being since it exits it cleanly. But there's gotta be a way to do this. Maybe even capture the process close and force a process tree close or something. I just wanna have to use 1 file instead of the 2. No big deal since the files are small but makes it clean for the user. Maybe can do a FileInstall and install my kill_child script with my wrapper and have the kill_child script delete itself after cleanup. 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