<?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=5843&amp;type=atom" />
	<updated>2011-05-28T11:50:48Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5843</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Потоки метки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48748#p48748" />
			<content type="html"><![CDATA[<p>Мне не совсем ясна цель всего этого, но в любом случае нужно учитывать, что AHK не поддерживает многопоточность, и начать новый поток можно, только прервав предыдущий.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-05-28T11:50:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48748#p48748</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Потоки метки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48746#p48746" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><div class="quotebox"><cite>Gorvin пишет:</cite><blockquote><p>Собственно есть возможность заставить его запустить второй поток TestLabel пока первый ждет нажатия кнопки мыши?</p></blockquote></div><div class="codebox"><pre><code>#MaxThreadsPerHotkey 2
test = 0
F12::
test++
if test &gt; 1
{
    MsgBox test: %test%
    return
}
KeyWait, LButton, D
MsgBox test: %test%
Return</code></pre></div></blockquote></div><p>То что MaxThreadsPerHotkey отлично работает для кнопки я прекрасно знаю, но меня интересует именно второй поток лейбла по таймеру. Пока нашел только кривой выход. Что тот nипа:<br /></p><div class="codebox"><pre><code>F12::
test++
SetTimer, TestLabel_%test%, 400
Return

TestLabel_1:
...
Return

TestLabel_2:
...
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Gorvin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26980</uri>
			</author>
			<updated>2011-05-28T11:00:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48746#p48746</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Потоки метки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48739#p48739" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Gorvin пишет:</cite><blockquote><p>Собственно есть возможность заставить его запустить второй поток TestLabel пока первый ждет нажатия кнопки мыши?</p></blockquote></div><div class="codebox"><pre><code>#MaxThreadsPerHotkey 2
test = 0
F12::
test++
if test &gt; 1
{
    MsgBox test: %test%
    return
}
KeyWait, LButton, D
MsgBox test: %test%
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-05-28T07:26:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48739#p48739</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Потоки метки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48736#p48736" />
			<content type="html"><![CDATA[<p>Есть матка которая запускается по SetTimer внутри которой есть пауза keywait, что собственно блокирует горячую клавишу.<br />Пример:<br /></p><div class="codebox"><pre><code>test = 0
F12::
test++
SetTimer, TestLabel, 400
Return


End::ExitApp

TestLabel:
SetTimer, TestLabel, off
if test &gt; 1
{
    MsgBox test: %test%
    return
}
KeyWait, LButton, D
MsgBox test: %test%
Return</code></pre></div><p>Если использовать MaxThreadsPerHotkey то он не выполняет метку в отдельном потоке, а дожидается завершения первого. Собственно есть возможность заставить его запустить второй поток TestLabel пока первый ждет нажатия кнопки мыши? Ну или хотя бы можно определить сколько запущено потоков обрабатывающих нажатие данной клавиши и если их два и более запустить другую метку?</p>]]></content>
			<author>
				<name><![CDATA[Gorvin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26980</uri>
			</author>
			<updated>2011-05-28T03:18:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48736#p48736</id>
		</entry>
</feed>
