<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; #ifWinActive не работает]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15542&amp;type=atom" />
	<updated>2020-07-24T23:21:50Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15542</id>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140980#p140980" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><p>Вечные циклы это же зло, все знают).</p></blockquote></div><p>Было у меня такое. Какая-то проблема в обращении к большому массиву при проверке условий.</p>]]></content>
			<author>
				<name><![CDATA[fgslm]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40966</uri>
			</author>
			<updated>2020-07-24T23:21:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140980#p140980</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140976#p140976" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><p>Были пару случаев, когда первая буква не успевала напечататься.</p></blockquote></div><p>Легко, но это уже другая тема, в таких случаях для гарантии можно ещё много чего написать, а тут про отслеживание окна.<br /></p><div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><p>Вечные циклы это же зло, все знают).</p></blockquote></div><p>Никогда не слышал такого. Можно вместо цикла установить уведомления, но в данном контексте это ни к чему. Тут нет другого функционала, и прерывания потока тут ни к чему.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-07-24T21:39:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140976#p140976</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140973#p140973" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong></p><p>Были пару случаев, когда первая буква не успевала напечататься. Ну и язык ввода имеет значение - то на англ. то на рус.<br />Проц всё потянет, в нём я уверен. Вечные циклы это же зло, все знают).</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2020-07-24T21:11:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140973#p140973</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140972#p140972" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><p>Данные же переписаны во второй строке.</p></blockquote></div><p>На всякий для тестов с блокнотом.<br /></p><div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><p>наверно лучше добавить задержку между вводом.</p></blockquote></div><p>WinWait[Not]Active проверяет окно с задержкой, или у вас грузит проц?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-07-24T20:20:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140972#p140972</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140969#p140969" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong></p><div class="codebox"><pre><code>WinTitle = ahk_class Notepad ahk_exe notepad.exe
WinTitle = Active Directory is not available</code></pre></div><p>Немного не понял, два значения в переменной? Данные же переписаны во второй строке.</p><br /><p><strong>murxer</strong></p><p>Бесконечный цикл, обратите внимание, наверно лучше добавить задержку между вводом.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2020-07-24T19:59:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140969#p140969</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140966#p140966" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><div class="codebox"><pre><code>
WinTitle = ahk_class Notepad ahk_exe notepad.exe
WinTitle = Active Directory is not available
Loop
{
	WinWaitActive, %WinTitle%
	Send, {LShift Down}abc{LShift Up}{Enter} 
	WinWaitNotActive 
}
</code></pre></div></blockquote></div><p>Спасибо! работает теперь как нужно <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />целый день возился )))</p>]]></content>
			<author>
				<name><![CDATA[murxer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40989</uri>
			</author>
			<updated>2020-07-24T19:45:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140966#p140966</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140962#p140962" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
WinTitle = ahk_class Notepad ahk_exe notepad.exe
WinTitle = Active Directory is not available
Loop
{
	WinWaitActive, %WinTitle%
	Send, {LShift Down}abc{LShift Up}{Enter} 
	WinWaitNotActive 
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-07-24T19:01:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140962#p140962</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140958#p140958" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>murxer пишет:</cite><blockquote><p><strong>fgslm</strong></p><p>спасибо, уже опознаёт окно, и ровно один раз срабатывает но потом вылетает, тоесть скрипт рушиться наверно и больше не срабатывает. Или loop не означает что <strong>при повторном появлении окна он должен сделать тоже самое</strong>?</p><br /><br /><br /><div class="codebox"><pre><code>
loop
{
IfWinExist, (&quot;Active Directory is not available&quot;)
{
    WinActivate
    return
}
loop
	{
	If WinActive(&quot;Active Directory is not available&quot;)
		{
			Send, {LShift Down}
			Send, abc
			Send, {LShift Up}
			Send, {Enter}
			Return
		}
	}
}
</code></pre></div><p>Но у вас может сложиться ситуация, что в это окно начнёт бесконечно спамить и бесконечно ставить его на передний план. Поэтому надо придумать паузу или выключение.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[fgslm]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40966</uri>
			</author>
			<updated>2020-07-24T18:36:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140958#p140958</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140957#p140957" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>murxer пишет:</cite><blockquote><p>и ровно один раз срабатывает но потом вылетает</p></blockquote></div><p>Нужно вставить это в еще один цикл и присвоить ему бесконечность</p>]]></content>
			<author>
				<name><![CDATA[fgslm]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40966</uri>
			</author>
			<updated>2020-07-24T18:32:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140957#p140957</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140956#p140956" />
			<content type="html"><![CDATA[<p><strong>fgslm</strong></p><p>спасибо, уже опознаёт окно, и ровно один раз срабатывает но потом вылетает, тоесть скрипт рушиться наверно и больше не срабатывает. Или loop не означает что при повторном появлении окна он должен сделать тоже самое?</p><br /><br /><br /><div class="codebox"><pre><code>IfWinExist, (&quot;Active Directory is not available&quot;)
{
    WinActivate
    return
}
loop
	{
	If WinActive(&quot;Active Directory is not available&quot;)
		{
			Send, {LShift Down}
			Send, abc
			Send, {LShift Up}
			Send, {Enter}
			Return
		}
	}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[murxer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40989</uri>
			</author>
			<updated>2020-07-24T18:17:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140956#p140956</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140931#p140931" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>murxer пишет:</cite><blockquote><p>IfWinExist, Название окна<br />{<br />&nbsp; &nbsp; WinActivate<br />&nbsp; &nbsp; return<br />}<br />loop<br />{<br />#IfWinActivate, Active Directory is not available ahk_class WindowsForms10.Window.8.app.0.2481e20_r58_ad15<br />Send, {LShift Down}<br />Send, {a}<br />Send, {b}<br />Send, {c}<br />Send, {LShift Up}<br />Send, {Enter}<br />Return<br />}</p></blockquote></div><p>Так наверно. Но я не шарю</p>]]></content>
			<author>
				<name><![CDATA[fgslm]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40966</uri>
			</author>
			<updated>2020-07-24T14:31:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140931#p140931</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140929#p140929" />
			<content type="html"><![CDATA[<p><span style="color: green"><strong>murxer</strong>, добавьте префикс скриптового языка в заголовок темы. Код должен быть оформлен тегом &quot;code&quot;. Исправьте!</span></p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2020-07-24T14:22:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140929#p140929</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140928#p140928" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>murxer пишет:</cite><blockquote><p>чтобы скрипт сам, при появлении этого окна,</p></blockquote></div><p>IfWinExist, Название окна<br />{<br />&nbsp; &nbsp; WinActivate<br />&nbsp; &nbsp; return<br />}<br />Это делает окно (название) активным</p>]]></content>
			<author>
				<name><![CDATA[fgslm]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40966</uri>
			</author>
			<updated>2020-07-24T14:21:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140928#p140928</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140927#p140927" />
			<content type="html"><![CDATA[<p>так работает только с нужным окном, уже хорошо, теперь бы автоматизировать, чтобы скрипт сам, при появлении этого окна, заносил эти при буквы в строку и нажимал enter</p><p>F3::<br />If WinActive(&quot;Active Directory is not available&quot;)<br />{<br />Send, {LShift Down}<br />Send, abc<br />Send, {LShift Up}<br />Send, {Enter}<br />Return<br />}</p>]]></content>
			<author>
				<name><![CDATA[murxer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40989</uri>
			</author>
			<updated>2020-07-24T14:16:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140927#p140927</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: #ifWinActive не работает]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=140898#p140898" />
			<content type="html"><![CDATA[<p>блин, кажеться не совсем понял принцип. Записной скрипт тоже всегда запускается (при нажатии на F3), не зависимо от того есть или нужное окно или нет.</p>]]></content>
			<author>
				<name><![CDATA[murxer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40989</uri>
			</author>
			<updated>2020-07-24T07:46:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=140898#p140898</id>
		</entry>
</feed>
