make 2nd thread to exit mainscript
Posted: 17 Nov 2022, 03:14
Code: Select all
2ndthread =
(
#Persistent
#NoTrayIcon
n:=5
loop,
{
sleep, 500
n++
Tooltip, `% n
if (n > 10)
ExitApp
}
)
dllpath:=A_AhkDir "\AutoHotkey.dll"
DllCall("LoadLibrary","Str",dllpath)
DllCall(dllpath "\ahktextdll","Str",2ndthread,"Str","","Str","","CDecl")
While DllCall(dllpath "\ahkReady")
Sleep 100
dll:=AhkThread(2ndthread)
While dll.ahkReady()
Sleep 100 ;
T::
MsgBox, mainscript ; when n from 2ndthread becomes greater than 10 i want this main script to show a messagebox and Exit the entire app.
return
what i am trying to do
----------------------------------------------------
when n from 2ndthread becomes greater than 10 i want this main script to show a messagebox and Exit the entire app.
current behaviour
---------------------------------------------------
it only exit the 2ndthread
Hope anybody will give me some insights into it