<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: возможен ли повторый вход в обработчик?]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=18090&amp;type=atom" />
	<updated>2024-02-05T12:13:22Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18090</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: возможен ли повторый вход в обработчик?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=160232#p160232" />
			<content type="html"><![CDATA[<p>Читайте <a href="https://www.autohotkey.com/docs/v1/lib/_MaxThreadsPerHotkey.htm">#MaxThreadsPerHotkey</a>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2024-02-05T12:13:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=160232#p160232</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: возможен ли повторый вход в обработчик?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=160226#p160226" />
			<content type="html"><![CDATA[<p>Добрый день.</p><p>Только познакомился с AHK.<br />Использую такой код:</p><div class="codebox"><pre><code>
global bRun := False ; Где-то в секции начального исполнения...

^!l:: ; Ctrl+Alt+L - engage the macro

/*
   1. Set the sign that the macro has started, of leave the addiotional thread if it is on.
*/

if (bRun)
{
	MsgBox, Already
	Exit ; Exit new thread, try to OnExit, ExitApp
}
else
{
	bRun := True
	hMainWnd := WinExist(&quot;ahk_class Notepad&quot;)
}

_MainLoop:</code></pre></div><p>Так сделал, чтобы при исполнении макроса для следующих нажатии Ctrl+Alt+L невозможно было снова попасть в этот обработчик, пока не обработано первое. Вопрос: а вообще возможно ли до Exit или return повторно попасть в обработчик, если он своей работы еще не закончил. У меня и не получается, такое впечатление, что есть какая-то настройка, запрещающая такое поведение, либо это невозможно в принципе.</p><p>В цикле, пока не будет нажата комбинация на прекращение макроса, что-то для теста пишет в Notepad, кликает мышкой. По логике работы может работать относительно долго. Так, сколько бы я ни жал Ctrl+Alt+L, ветка с сообщением о повторном входе никогда не получает управления.</p><p>Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[GreenSoldier]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43550</uri>
			</author>
			<updated>2024-02-05T09:48:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=160226#p160226</id>
		</entry>
</feed>
