AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Application close notify

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
godsstigma



Joined: 04 Nov 2008
Posts: 222
Location: Memphis, TN

PostPosted: Fri Feb 12, 2010 1:53 pm    Post subject: Application close notify Reply with quote

Is there anyway for a script/executable to know if it is being closed via taskman or the command line, and if so can we pause the termination to execute some code beforehand?

Further explanation:
I have a script that hides/shows windows. If this script is terminated by means other than through the script, the hidden windows will stay in that state until the script is executed again.
Back to top
View user's profile Send private message
jorgy
Guest





PostPosted: Fri Feb 12, 2010 2:50 pm    Post subject: Reply with quote

Look in the help file for "OnExit". With it you can detect when the script is closing and the reason for the close. You can then take approriate action before the script terminates.
Back to top
godsstigma



Joined: 04 Nov 2008
Posts: 222
Location: Memphis, TN

PostPosted: Fri Feb 12, 2010 3:34 pm    Post subject: Reply with quote

Thanks, but I have reviewed the help file.
The first line in the "OnExit" help page:
Quote:
The OnExit subroutine is called when the script exits by any means (except when it is killed by something like "End Task").


"End Task" would be referring to the task manager or command line.

The only thing i can think of is maybe monitoring a system message?

Any suggestions?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group