dirty Posted February 23, 2010 Posted February 23, 2010 When External app is trying to close my script is there any way i could have my script to know about it ? For example using another script to close compiled running loop, is there anyway for that compiled running loop to identify that something is trying to close it and run some sort of function ? Maybe something like onAutoitClose or maybe i need some kind of case for my loop ? while1 Case $On_Autoit_Close somefunc() wend Func somefunc() msgbox(0,'','something is closing this app') ;do something Then Exit endfunc BTW there is no GUI or anything like that, just this simple loop with checking if process exist or not. I think i saw this somewhere but i just cant find it anymore. Am i looking for impossible ? Thanks in advance.
AdmiralAlkex Posted February 24, 2010 Posted February 24, 2010 Sounds like you want OnAutoItExitRegister() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
dirty Posted February 24, 2010 Author Posted February 24, 2010 (edited) On 2/24/2010 at 1:04 AM, 'AdmiralAlkex said: Sounds like you want OnAutoItExitRegister() Registers a function to be called when AutoIt exits ? I think i need to execute function but maybe i dont understand the word register ? Ok its registered, then what ? Does it register function that will be executed once script is exited ? Thanks I found Opt("OnExitFunc", "endscript") somehow its not working with current AUTOIT release. Saying ERROR: Opt() called with illegal argument 1: "OnExitFunc" Opt("OnExitFunc", "endscript") And for some reaons for Opt help file shows AutoItSetOption ( "option" [, param] ) Also i cant open any script from help file after installing new version. With new version somethings just dont work, for example code prediction as you type would sometimes go away for no reason at the beginning of typing command (" Strange Edited February 24, 2010 by dirty
FinalVersion Posted February 24, 2010 Posted February 24, 2010 Taken from the help file (Your best source for help) "Registers a function to be called when AutoIt exits.". So yes, when it exists the function will be called. Also out of curiosity, what is trying to close you script? An Anti Virus? [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center]
dirty Posted February 24, 2010 Author Posted February 24, 2010 On 2/24/2010 at 4:54 AM, 'FinalVersion said: Taken from the help file (Your best source for help) "Registers a function to be called when AutoIt exits.". So yes, when it exists the function will be called.Also out of curiosity, what is trying to close you script? An Anti Virus?FireDaemon. I just want to make sure critical exit code executed before it shut down.I also noticed that ending process in task manager voids this function, so how do other applications exiting my script ? Do they close it gently or something ?I wonder if autoit can close other applications gently, not just by processclose command.Thanks for reply
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