12-10-2013, 08:13 AM
If I have two windows, and use the same function to run simultaneously. I know this will have two different thread ids, and I can use the codes from QM help to Display all threads, but I don't know which one thread id is belong to which function, because they have use the same function name.
Because the function is loop, so it will run forever. If I want to use EndThread to stop one thread, and the other will run continually , how to do?
Macro Macro2
Because the function is loop, so it will run forever. If I want to use EndThread to stop one thread, and the other will run continually , how to do?
Macro Macro2
;start1
int vk1=wait(0 K)
int+ w1 = GetMousePointWindow()
if (vk1 = 118)
,mac "Function"
if (vk1 = 119)
,;Display all threads
,int i n=EnumQmThreads(0 0 0 0)
,ARRAY(QMTHREAD) a.create(n)
,for i 0 EnumQmThreads(&a[0] n 0 0)
,,out _s.getmacro(a[i].qmitemid 1)
,,out a[i].threadid
,,out a[i].threadhandle
goto start1