Thanks for clarifying, Lexikos.
In my script #MaxThreads and #MaxThreadsPerHotkey are both unspecified, so default values should be in place (10 and 1 threads respectively). Does this mean that the 1:: thread is still running? I don't see how this could be.
Originally what I wanted to do was write a context-sensitive hotkey based on the currently active window. Since the hotkey is triggered by LButton & g, and clicking gives focus to the window under the mouse, this saves one step (first activating the window by clicking and then launching the command). The problem is with Explorer. In Explorer, when you click on a file icon rather than the white are around it, that is the SysListView321 control, the window does not take focus until you release the mouse button. Initially I was sending {LButton Up} from within the #If statement, but this didn't work. I have now found a better way to do this.
;Determines whether hovered window belongs to previously defined ahk_group
HoverWinGroupIs(GroupName) ;e.g. ahk_group Explorer
{
MouseGetPos,,, HoverWinID
Return WinExist(" ahk_id " . HoverWinID . " " . GroupName) ;note multiple criteria
}Up until today I wasn't aware of this, but the fact is that
several "ahk_" parameters can be combined into one WinTitle string. This information is actually in the help file, but the example given (and in fact most examples I have seen) follow the format
My file.txt ahk_class Notepad (note just one instance of
ahk_). Today it crossed my mind that this might work and it did, and finally I was able to write the above function. I am sure this is no news to a lot of you, but this knowledge has opened a lot of new possibilities for me so I want to share it with the community.