which function can exit thread in ahk_h beta3?
Posted: 07 Feb 2022, 06:24
In ahk_h beta3 , I tried to use ahkterminate , but it seems don't work . Is there any other function to exit the thread?
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=67&t=100005
Code: Select all
ahk:=NewThread("MsgBox 'Thread'")
Sleep 1000
ahk.ahkterminate()
MsgBox 'End'
Code: Select all
script1 := "
(
#NoTrayIcon
Persistent
loop
{
ToolTip "s1-" A_index, 100, 150
sleep 50
}
)"
script2 := "
(
#NoTrayIcon
Persistent
Loop
{
ToolTip "s2-" A_index, 200, 150
sleep 50
}
)"
F1::
{
MyThread1:=NewThread(script1)
MyThread2:=NewThread(script2)
}
F2::
{
if (IsSet(MyThread1))
MyThread1.ahkterminate()
if(IsSet(MyThread2))
MyThread2.ahkterminate()
}