<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Process Wait для двух или более процессов]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16386&amp;type=atom" />
	<updated>2021-05-27T14:00:49Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16386</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Process Wait для двух или более процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148120#p148120" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> да, это проще для понимания.<br />Что-то подобное я пытался сделать, но не додумал.<br />Благодарю за помощь!</p>]]></content>
			<author>
				<name><![CDATA[BlackCat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41382</uri>
			</author>
			<updated>2021-05-27T14:00:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148120#p148120</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Process Wait для двух или более процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148119#p148119" />
			<content type="html"><![CDATA[<p>Можно проще:<br /></p><div class="codebox"><pre><code>processes := [&quot;notepad.exe&quot;, &quot;notepad++.exe&quot;]
Loop {
   Sleep, 1000
   for k, exe in processes {
      Process, Exist, % exe
      if (PID := ErrorLevel) {
         name := exe
         break 2
      }
   }
}
MsgBox, % &quot;PID: &quot; . PID . &quot;`nname: &quot; . exe</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-05-27T13:57:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148119#p148119</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Process Wait для двух или более процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148118#p148118" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Круто! Ничего не понял, но это работает! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Буду разбираться с этим кодом.<br />Большое благодарю!</p>]]></content>
			<author>
				<name><![CDATA[BlackCat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41382</uri>
			</author>
			<updated>2021-05-27T13:50:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148118#p148118</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Process Wait для двух или более процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148116#p148116" />
			<content type="html"><![CDATA[<p>Такой код будет ждать либо notepad.exe, либо notepad++.exe:<br /></p><div class="codebox"><pre><code>obj := {processes: [&quot;notepad.exe&quot;, &quot;notepad++.exe&quot;], exist: &quot;&quot;}
timer := Func(&quot;IsProcessExist&quot;).Bind(obj)
SetTimer, % timer, 1000
while !obj.exist
   Sleep, 100
; остальная часть скрипта:
MsgBox, % &quot;process: &quot; . obj.exist.name . &quot;`nPID: &quot; . obj.exist.PID
Return

IsProcessExist(obj) {
   for k, exe in obj.processes {
      Process, Exist, % exe
      if (PID := ErrorLevel) {
         SetTimer,, Delete
         obj.exist := {name: exe, PID: PID}
         break
      }
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-05-27T13:21:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148116#p148116</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Process Wait для двух или более процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148113#p148113" />
			<content type="html"><![CDATA[<p>Добрый день!<br />Подскажите пожалуйста, если возможна такая конструкция без применения таймера в принципе, как сделать ожидание Process Wait для одного ИЗ двух и более обозначенных процессов?<br />Необходимо именно ожидание запуска процесса, а не проверка его существования.<br />Основная задача должна запускаться после запуска одного любого из процессов, обозначенных, например в Array[].<br />Что то по такой схеме:<br /></p><div class="codebox"><pre><code>
Process Wait, A | Process Wait, B
... в случае запуска одного из процессов, выполняется остальная часть скрипта
</code></pre></div><p>Признателен за любую помощь!</p>]]></content>
			<author>
				<name><![CDATA[BlackCat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41382</uri>
			</author>
			<updated>2021-05-27T11:15:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148113#p148113</id>
		</entry>
</feed>
