Jump to content

Recommended Posts

Posted

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. :)

Posted
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.

Posted (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.

image.png.9ac102cca3ada30bc86e79b0745612bb.png     image.png.135a7e34d71f3eb4dda2f75f872365f7.png

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 :lol:

Edited by argumentum
having fun

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...