| View previous topic :: View next topic |
| Author |
Message |
triwebb1
Joined: 06 Mar 2008 Posts: 20
|
Posted: Wed Apr 23, 2008 1:01 am Post subject: How do I pause another script? |
|
|
Hi. I have several scripts running at once, and I want it so that when I hit the pause key they all pause. Does anyone know how to do this? I can make it work fine for one script, but when I run two instances of that script, only the last one to start responds to hotkeys.
I am using a token-passing system to allow the scripts to pass along control of the mouse, and I could easily add a bit to send/recieve a pause message, but I have been unsuccessful at making the script pause when it receives that message.
I am guessing that it is a limitation of AHK to only be able to have one script respond to the pause key, and that is why I mentioned the message passing bit. I have not thoroughly investigated/debugged the pause message part, I will do so right now to see if I can find out why it doesn't work. |
|
| Back to top |
|
 |
Epuls56
Joined: 19 Apr 2008 Posts: 33
|
Posted: Wed Apr 23, 2008 1:09 am Post subject: |
|
|
| Have you tied #SingleInstance? |
|
| Back to top |
|
 |
triwebb1
Joined: 06 Mar 2008 Posts: 20
|
Posted: Wed Apr 23, 2008 1:27 am Post subject: |
|
|
| That would defeat the purpose, I believe. Do you mean turn it on or off? I have it turned on. What I have is a manager script, and a worker script. I run one instance of the manager, and multiple instances of the worker. I need the pause key to work for the manager and all instances of the worker. |
|
| Back to top |
|
 |
Z Gecko Guest
|
|
| Back to top |
|
 |
triwebb1
Joined: 06 Mar 2008 Posts: 20
|
Posted: Wed Apr 23, 2008 5:41 am Post subject: |
|
|
Thank you very much for finding that for me - I should have looked harder... I will use that message code as it is very easy.
Anyway, I found my problem, and it was a silly one. I forgot to make the array that contains the window IDs global in this new function, and that is why the worker scripts never got the message. It's always the little things that cause the most frustration... |
|
| Back to top |
|
 |
|