AutoHotkey Community

It is currently May 25th, 2012, 10:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: July 7th, 2007, 3:56 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
boge wrote:
i dont know in which application it get stuck... and to kill the specific one means that i have to know exactly in which part my ahk application get stuck... am i right??

So set a gobal variable from inside run() to indicate which process the script is currently waiting for. For instance, you could store the value returned by the OutputVarPID parameter of Run/RunWait, if that's what run() uses internally.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2007, 9:12 am 
Offline

Joined: May 16th, 2007, 3:24 pm
Posts: 11
thanks all for your answers...

it can be used to solve the problem...

but back to my first question... is it any way in ahk to reset/kill the current thread without exiting the application?...
i expect something similar with pause, but not like pause which is only freezing the thread, i would like to be able to kill that thread....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2007, 12:48 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
boge wrote:
but back to my first question... is it any way in ahk to reset/kill the current thread without exiting the application?...
Yes, Exit, as Superfraggle mentioned.
boge wrote:
maybe the exit is what i'm looking for, but is that any way to call it from another thread, let say by pressing a button, to close another thread?
What you are asking is not to exit the current thread, but to exit the underlying thread. I believe that is currently not possible.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2007, 1:25 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
The answers given above are correct: Exit is the way that the current thread should terminate itself (or "return" if it's the final return of the thread). There is no way for the current thread to directly terminate any thread that lies suspended/interrupted beneath it. However, it may indirectly do so by signaling the other thread to terminate itself. For example, after the upper thread sets the signal (e.g. via global variable), it terminates itself (via return or exit), which allows the underlying thread to resume. Then the underlying thread sees that the global variable has changed (via a Loop containing the Sleep command) and exits/returns itself.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2007, 3:59 pm 
Offline

Joined: May 16th, 2007, 3:24 pm
Posts: 11
Quote:
What you are asking is not to exit the current thread, but to exit the underlying thread. I believe that is currently not possible.

yes you are right... so now i know it's not possible... thanks...

Quote:
However, it may indirectly do so by signaling the other thread to terminate itself.

I think this is a good way to do it...

thanks again guys...


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], Wicked and 63 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:
Powered by phpBB® Forum Software © phpBB Group