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 

hotkey for emergency exit

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
guessed
Guest





PostPosted: Wed Apr 13, 2005 10:42 pm    Post subject: hotkey for emergency exit Reply with quote

I want to create an emergency hotkey which exits all or selected threads but keeps the script alive

so far my understanding is that Exit just kills its on thread and ExitApp kills the whole script - any idea (maybe a PostMessage)? Thanx!
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Wed Apr 13, 2005 11:22 pm    Post subject: Reply with quote

Although there's no easy way to do this, you could assign a hotkey to pause and unpause all threads:

^!p::Pause ; Press it once to pause all threads, and again to unpause.

If you still need a way to kill all other threads, probably the only solution is to set a global variable that each thread is responsible for checking periodically. Each thread should exit when it sees the variable change to a pre-arranged stop-signal.
Back to top
View user's profile Send private message Send e-mail
TeknoMusicMan



Joined: 14 Apr 2005
Posts: 188
Location: Wisconsin, USA

PostPosted: Thu Apr 14, 2005 12:01 pm    Post subject: Reply with quote

You could try the Reload command for stopping all threads

The only problem with that is if you have any dynamic variables they would be cleared out.
Allthough a way around that would be to write the all the values of all your variables to a txt file before executing the reload command and then having your script read the file on load.

Just a thought
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
niwi



Joined: 27 Feb 2005
Posts: 128
Location: Heidelberg, Germany

PostPosted: Thu Apr 14, 2005 12:07 pm    Post subject: Reply with quote

Hi,

maybe this will work:
You create everey thread in an own ahk file. Than you write a launcher script which will execute all these scripts. And every pre-selected script react on the hotkey.

NiWi.
Back to top
View user's profile Send private message
Sephra



Joined: 11 Apr 2005
Posts: 4
Location: So-Cal

PostPosted: Fri Apr 15, 2005 6:43 pm    Post subject: Reply with quote

Chris wrote:
Although there's no easy way to do this, you could assign a hotkey to pause and unpause all threads:

^!p::Pause ; Press it once to pause all threads, and again to unpause.


That makes it seem like the puase command affects all threads. Does it? I didn't think so...
_________________
"Truly great madness cannot be achieved without significant intelligence." --Henrik Tikkanen
Back to top
View user's profile Send private message
TeknoMusicMan



Joined: 14 Apr 2005
Posts: 188
Location: Wisconsin, USA

PostPosted: Fri Apr 15, 2005 7:08 pm    Post subject: Reply with quote

Quote:
Unlike Suspend -- which disables hotkeys -- pause will freeze the current thread (and as a result, all interrupted threads beneath it will lie dormant).
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   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