<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: игнорирование условия IfWinActive, срабатывание везде]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11019&amp;type=atom" />
	<updated>2015-10-21T03:49:59Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11019</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: игнорирование условия IfWinActive, срабатывание везде]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98054#p98054" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Верю, но не в данном случае; список подпунктов данного меню генеририруется как-то хитро, после запуска программы, и боюсь, недоступен для данного метода.</p></blockquote></div><p>Раз работает с шорткатами, значит должно работать и с winmenuselectitem даже если название меняется. (в названии меню будет стоять &amp;перед горячей клавишей, следовательно можно парсить.)<br />Вот код от Teadrinker для определения всех подпунктов меню:<br /><a href="http://forum.script-coding.com/viewtopic.php?id=10980&amp;p=2">http://forum.script-coding.com/viewtopi … 80&amp;p=2</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-21T03:49:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98054#p98054</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: игнорирование условия IfWinActive, срабатывание везде]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98053#p98053" />
			<content type="html"><![CDATA[<p>Вопрос закрыт, кажется, я сам дурак (полагаю, это почти всегда ответ):<br /></p><div class="codebox"><pre><code>#IfWinActive, ahk_class illustrator
#vk5A:: ;z zoom to selection
SendMessage, 0x50, , 0x4090409, , ahk_class illustrator
send {alt down}{f}{alt up}
send {r}{v}{3}
return
#IfWinActive</code></pre></div>]]></content>
			<author>
				<name><![CDATA[chegr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30575</uri>
			</author>
			<updated>2015-10-21T03:39:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98053#p98053</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: игнорирование условия IfWinActive, срабатывание везде]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98052#p98052" />
			<content type="html"><![CDATA[<p>Хотки надо вставлять внутрь директивы:<br /></p><div class="codebox"><pre><code>#IfWinActive, ahk_class illustrator
#vk5A::
SendMessage, 0x50, , 0x4090409, , ahk_class illustrator
send {alt down}{f}{alt up}
send {r}{v}{3}
return
#IfWinActive</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-21T03:37:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98052#p98052</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: игнорирование условия IfWinActive, срабатывание везде]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98051#p98051" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Для выбора меню лучше использовать WinMenuSelectItem.</p></blockquote></div><p>Верю, но не в данном случае; список подпунктов данного меню генеририруется как-то хитро, после запуска программы, и боюсь, недоступен для данного метода. А вот по клавишам — работает (и имена подпунктов настроены именно под клавиатуру).<br />Суть вопроса в другом — почему код срабатывает везде, а не только в целевом окне?</p>]]></content>
			<author>
				<name><![CDATA[chegr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30575</uri>
			</author>
			<updated>2015-10-21T03:36:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98051#p98051</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: игнорирование условия IfWinActive, срабатывание везде]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98050#p98050" />
			<content type="html"><![CDATA[<p>Использование закрывающей директивы не помогло <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /><br /></p><div class="codebox"><pre><code>#vk5A::
#IfWinActive, ahk_class illustrator
SendMessage, 0x50, , 0x4090409, , ahk_class illustrator
send {alt down}{f}{alt up}
send {r}{v}{3}
return
#IfWinActive</code></pre></div>]]></content>
			<author>
				<name><![CDATA[chegr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30575</uri>
			</author>
			<updated>2015-10-21T03:33:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98050#p98050</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: игнорирование условия IfWinActive, срабатывание везде]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98049#p98049" />
			<content type="html"><![CDATA[<p><a href="http://www.script-coding.com/AutoHotkey/IfWinActive.html">http://www.script-coding.com/AutoHotkey … ctive.html</a><br />Для выбора меню лучше использовать, WinMenuSelectItem.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-21T03:29:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98049#p98049</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: игнорирование условия IfWinActive, срабатывание везде]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98048#p98048" />
			<content type="html"><![CDATA[<p>У меня есть один общий скрипт, в котором сведена все необходимая мне функциональность.<br />Часть из них нужна для работы в одной программе, часть — в другой, третья — вообще везде.<br />Но я заметил, что несмотря на выставленное условие, код выполняется везде:<br /></p><div class="codebox"><pre><code>#NoEnv
#Persistent
#SingleInstance force
SetKeyDelay, -1

;other stuff

#vk5A::
IfWinActive, ahk_class illustrator
SendMessage, 0x50, , 0x4090409, , ahk_class illustrator
send {alt down}{f}{alt up}
send {r}{v}{3}
return</code></pre></div><p>Этот фрагмент кода разворачивает нажатие Win+A в последовательность нажатий, чтобы добраться до нужного пункта меню в Adobe Illustrator, на который нельзя повесить горячую клавишу штатными средствами. То есть в данном виде он работает, но зачем-то срабатывает так же в других программах.<br />Что я делаю не так?</p>]]></content>
			<author>
				<name><![CDATA[chegr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30575</uri>
			</author>
			<updated>2015-10-21T02:54:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98048#p98048</id>
		</entry>
</feed>
