WildByDesign Posted 17 hours ago Posted 17 hours ago So I have two compiled AutoIt binaries in my current project. One of them uses ProcessClose successfully on the other. The one that is being closed has some special cleanup being done on exit such as running one last function and also releasing some resources. My worry is that it might not be running that cleanup routine when using ProcessClose from the other AutoIt binary. If I use OnAutoItExitRegister to register cleanup function within that binary that is being closed, will that run the cleanup routine correctly? I was not sure if that function was just intended for running from au3 script or if it worked in compiled AutoIt binary as well. Thank you.
Developers Solution Jos Posted 16 hours ago Developers Solution Posted 16 hours ago Why ask and not simply test? Could be you need to use WinClose() to send a close message to the other AutoIt3 task to properly closed it. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
WildByDesign Posted 16 hours ago Author Posted 16 hours ago 7 minutes ago, Jos said: Why ask and not simply test? Could be you need to use WinClose() to send a close message to the other AutoIt3 task to properly closed it. Very good point, sorry for that. I wasn’t at my PC at that moment and was curious to know the answer. Excellent suggestion with WinClose function. I was not very familiar with the difference between ProcessClose and WinClose and now I finally understand. Thank you for your help.
argumentum Posted 16 hours ago Posted 16 hours ago (edited) 1 hour ago, WildByDesign said: So I have two compiled AutoIt binaries in my current project. One of them uses ProcessClose successfully on the other. An AutoIt compiled script loads the script from an internal resource. And AutoIt (not compiled) loads the script from file as a resource. ProcessClose() or WinKill() should not be used, ever. That is like unplugging the PC (for the program). And both do the same thing. WinClose() will do nicely ( like Jos pointed out above ). If you have a script ( compiled or not ) running as user level, it will not have permissions to do anything to another running at an admin level ( that I guess is the "problem" you're having ) ...but by now ( am slow at typing ) the OP is satisfied but I wrote all this so..., here Edited 16 hours ago by argumentum having fun WildByDesign 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
WildByDesign Posted 16 hours ago Author Posted 16 hours ago @argumentum The way in which you described how the scripts are run, whether compiled or not, and the way that you described the different methods for closing processes was absolutely perfect. I mean it, that was very beneficial to me and helped my understanding a lot. Thank you. argumentum 1
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