AutoHotkey Community

It is currently May 26th, 2012, 8:03 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: April 13th, 2005, 11:42 pm 
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!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2005, 12:22 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2005, 1:01 pm 
Offline

Joined: April 14th, 2005, 11:11 am
Posts: 186
Location: Wisconsin, USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2005, 1:07 pm 
Offline

Joined: February 27th, 2005, 5:51 pm
Posts: 139
Location: Heidelberg, Germany
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 15th, 2005, 7:43 pm 
Offline

Joined: April 12th, 2005, 12:57 am
Posts: 3
Location: So-Cal
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 15th, 2005, 8:08 pm 
Offline

Joined: April 14th, 2005, 11:11 am
Posts: 186
Location: Wisconsin, USA
Quote:
Unlike Suspend -- which disables hotkeys -- pause will freeze the current thread (and as a result, all interrupted threads beneath it will lie dormant).


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: poserpro, sjc1000, Tilter_of_Windmills, Yahoo [Bot] and 54 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Group