Code: Select all
AhkThread("AhkExported().AhkPostFunction(""threadCallback"", ""Sent from thread."")")
threadCallback(msg) {
MsgBox % msg
}
MsgBox
Contrast this to executing the AutoHotkey_H v2.0-a110 (2f077b2) syntactic counterpart, where neither crashes nor hangs can be observed. First, the thread callback message box is displayed. It is only then, after it has been dismissed, that the parent script's default message box pops up.
Code: Select all
AhkThread('AhkExported().AhkPostFunction("threadCallback", "Sent from thread.")')
threadCallback(msg) => MsgBox(msg)
MsgBox