AUTOIT (Multi Hilo - multiThread) SOLUCION encontrada.
Publicado: 26 Oct 2015, 16:28
Hola a todos, he estado revisando el foro de ingles de autoit y he encontrado una posible solución para hacer multiHilo nuestros scripts, pongo el código encontrado en la página.
Si alguien sabe dar una explicación técnica con respecto al código, sería genial para ir aprendiendo ademas de que fuese bueno que dijeran sus ventajas o desventajas del código en cuestion.
LINK DE LA PÁGINA
https://www.autoitscript.com/forum/topi ... nt-1278147
Saludos...
Si alguien sabe dar una explicación técnica con respecto al código, sería genial para ir aprendiendo ademas de que fuese bueno que dijeran sus ventajas o desventajas del código en cuestion.
LINK DE LA PÁGINA
https://www.autoitscript.com/forum/topi ... nt-1278147
Código: Seleccionar todo
Func _START_BACKGROUND_FUNCTION($f)
Local $handle = DllCallbackRegister("_SubThread", "int", "ptr")
Local $dllstr = DllStructCreate("Char[200]")
DllStructSetData($dllstr, 1, $f) ;arg/parameter 1
Local $return = DllCall("kernel32.dll", "hwnd", "CreateThread", "ptr", 0, "dword", 0, "long", DllCallbackGetPtr($handle), "ptr", DllStructGetPtr($dllstr), "long", 0, "int*", 0)
;$return[0] - handle
;$return[6] - thread id
EndFunc ;==>_START_BACKGROUND_FUNCTION
Func _SubThread($x)
Local $get = DllStructCreate("char[200]", $x)
Call( DllStructGetData($get, 1))
EndFunc ;==>_SubThread
Func _TEST()
MsgBox(0,"","Yes but there are so many problems that it is very limited.")
EndFunc
Func _TEST2()
MsgBox(0,":)","(: :) :(")
EndFunc
_START_BACKGROUND_FUNCTION("_TEST")
_START_BACKGROUND_FUNCTION("_TEST2")
msgbox (0,0,"Can AutoIt mutlithread"); if you close main process all subtreads are closed