https://www.autohotkey.com/boards/viewtopic.php?t=7340
Code: Select all
#Persistent
a := 12
fn := Func("z").Bind(a)
SetTimer, %fn%, -0
z(a)
{
MsgBox, % a
}
-Edit-
Solved.
Using a obj:
Code: Select all
obj := {}
timer := Func("f").Bind(obj)
obj.Timer := timer
SetTimer, %timer%, -1
Sleep, 2000
return
f(arg, args*)
{
timer := arg.Delete("Timer")
SetTimer, %timer%, Delete
MsgBox, %A_ThisFunc%
}