<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: получить переменную из потока autohotkey.dll]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13181&amp;type=atom" />
	<updated>2017-11-10T17:33:26Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13181</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: получить переменную из потока autohotkey.dll]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121015#p121015" />
			<content type="html"><![CDATA[<p>Спасибо.<br />Код из справки почему-то выдавал какие-то цифры.</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-11-10T17:33:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121015#p121015</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: получить переменную из потока autohotkey.dll]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121005#p121005" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Dworkin пишет:</cite><blockquote><p>Скажите пожалуйста как вытащить переменную var из запущеного потока?</p><p>Вот справка:<br /><a href="https://hotkeyit.github.io/v2/docs/commands/ahkgetvar.htm">https://hotkeyit.github.io/v2/docs/comm … getvar.htm</a></p></blockquote></div><p>А в чём подвох? Код из справки у вас не работает?<br /></p><div class="codebox"><pre><code>
dllpath:= &quot;AutoHotkey.dll&quot;
codefromvar =
(
var := 5
MsgBox, Hello World!
)

DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,dllpath) ; Load the AutoHotkey module.
DllCall(dllpath &quot;\ahktextdll&quot;,&quot;Str&quot;,codefromvar,&quot;Str&quot;,&quot;&quot;,&quot;CDecl&quot;) ; start a new thread from file.
OutputVar := DllCall(dllpath &quot;\ahkgetvar&quot;, &quot;Str&quot;, &quot;Var&quot;, &quot;UInt&quot;, 0 ,&quot;CDecl Str&quot;)
MsgBox, %OutputVar%
While DllCall(dllpath &quot;\ahkReady&quot;)
  Sleep 100 ; wait for the thread to exit
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2017-11-10T04:31:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121005#p121005</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: получить переменную из потока autohotkey.dll]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120997#p120997" />
			<content type="html"><![CDATA[<p>Видел для _L <a href="https://autohotkey.com/boards/viewtopic.php?f=6&amp;t=6194">такую ф-ию</a> с доступом к переменным и функциям дочернего процесса. Не поток, но все же.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2017-11-09T19:17:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120997#p120997</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: получить переменную из потока autohotkey.dll]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120996#p120996" />
			<content type="html"><![CDATA[<p>Добрый вечер. Решил немного изучить многопоточность в ahk с помощью autohotkey.dll.</p><p>Сам autohotkey.dll скачал отсюда:<br /><a href="https://raw.githubusercontent.com/HotKeyIt/ahkdll-v1-release/master/Win32w/AutoHotkey.dll">https://raw.githubusercontent.com/HotKe … Hotkey.dll</a><br />Библиотеки отсюда:<br /><a href="https://github.com/HotKeyIt/ahkdll-v2-release/blob/master/Compiler/Lib/AhkExported.ahk">https://github.com/HotKeyIt/ahkdll-v2-r … ported.ahk</a><br /><a href="https://github.com/zhamlin/Macro/blob/master/lib/AhkDllThread.ahk">https://github.com/zhamlin/Macro/blob/m … Thread.ahk</a></p><p>НО их я закинул в папку lib где установлен autohotkey иначе через #include почему-то не работает.</p><p>Нормально запускает скрипт файл в другом потоке:<br /></p><div class="codebox"><pre><code>dllpath:= &quot;AutoHotkey.dll&quot;
DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,dllpath) ; Load the AutoHotkey module.
DllCall(dllpath &quot;\ahkdll&quot;,&quot;Str&quot;,A_ScriptDir &quot;\httptest.ahk&quot;,&quot;Str&quot;,&quot;&quot;,&quot;CDecl&quot;) ; start a new thread from file.
While DllCall(dllpath &quot;\ahkReady&quot;)
  Sleep 100 ; wait for the thread to exit</code></pre></div><p>Можно ли и как вытащить переменную из запущенного скрипта в другом потоке?</p><p>Нормально запускает код:<br /></p><div class="codebox"><pre><code>dllpath:= &quot;AutoHotkey.dll&quot;
codefromvar =
(
var := 5
MsgBox, Hello World!
)

DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,dllpath) ; Load the AutoHotkey module.
DllCall(dllpath &quot;\ahktextdll&quot;,&quot;Str&quot;,codefromvar,&quot;Str&quot;,&quot;&quot;,&quot;CDecl&quot;) ; start a new thread from file.
While DllCall(dllpath &quot;\ahkReady&quot;)
  Sleep 100 ; wait for the thread to exit</code></pre></div><p>Скажите пожалуйста как вытащить переменную var из запущеного потока?</p><p>Вот справка:<br /><a href="https://hotkeyit.github.io/v2/docs/commands/ahkgetvar.htm">https://hotkeyit.github.io/v2/docs/comm … getvar.htm</a></p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-11-09T18:55:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120996#p120996</id>
		</entry>
</feed>
