Jump to content

Question about OnAutoItStart and OnAutoItExit


Recommended Posts

Hello. I've been creating an AutoIt script for other AutoIt programmers (used via #include), and this script needs to do some things before any of my functions are called and immediately before the program closes. So far, I've been using OnAutoItStart and OnAutoItExit. However, I noticed that if I use these two functions, then whoever #includes my file cannot use these functions themselves, because then there are two functions with the same name. Is there a way around this, or should I make the user call a function before and after using my other functions, which I have been trying to avoid? Thanks.

Link to comment
Share on other sites

  • Moderators

Hmm, not sure I'd want anyone offering me something they control what it does when it starts or when it exits. If it's an #include, it's going to load first anyway... just make a disclaimer to add to your OnAutoItExit (they'll get a duplicate function error more than likely anyway) if they want to use your #include.

Without knowing what your #include is, it's hard to even tell if spawning another process would be effecitve.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanks for the help. My OnAutoItStart function creates a few global variables, registers a couple GUI messages via GUIRegisterMsg, and through a DllCall, calls GdiplusStartup. My OnAutoItExit function calls GdiplusShutdown and deletes some objects created by gdiplus and gdi32 throughout my script, such as device contexts, brushes, and pens.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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