<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Определение PID фоновых процессов с одинаковым именем]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16773&amp;type=atom" />
	<updated>2021-12-01T19:03:54Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16773</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Определение PID фоновых процессов с одинаковым именем]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150880#p150880" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Ну это то что нужно без смс и регистраций. Огромное спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Turuan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41011</uri>
			</author>
			<updated>2021-12-01T19:03:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150880#p150880</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Определение PID фоновых процессов с одинаковым именем]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150873#p150873" />
			<content type="html"><![CDATA[<p>Можно так:<br /></p><div class="codebox"><pre><code>PIDs := EnumProcessesByName(&quot;msedge.exe&quot;)
for k, pid in PIDs
   str .= pid . &quot;`n&quot;
MsgBox, % str

EnumProcessesByName(searchName, regEx := false) {
   if !DllCall(&quot;Wtsapi32\WTSEnumerateProcesses&quot;, &quot;Ptr&quot;, 0, &quot;UInt&quot;, 0, &quot;UInt&quot;, 1, &quot;PtrP&quot;, pProcessInfo, &quot;UIntP&quot;, count)
      throw &quot;WTSEnumerateProcesses failed, error &quot; . A_LastError
   
   addr := pProcessInfo, PIDs := []
   Loop % count  {
      procName := StrGet( NumGet(addr + 8) )
      if ( regEx &amp;&amp; RegExMatch(procName, searchName) ) || (procName = searchName)
         PID := NumGet(addr + 4, &quot;UInt&quot;), PIDs.Push(PID)
      addr += 8 + A_PtrSize*2
   }
   DllCall(&quot;Wtsapi32\WTSFreeMemory&quot;, &quot;Ptr&quot;, pProcessInfo)
   Return PIDs
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-12-01T14:12:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150873#p150873</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Определение PID фоновых процессов с одинаковым именем]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150872#p150872" />
			<content type="html"><![CDATA[<p>Приветствую. <br />Подскажите пожалуйста, как можно определить все PID-ы фоновых процессов,&nbsp; если у них одинаковые имена.<br />не нашел подходящего параметра в документации, так же в документации приводится примеры с использованием dll, но я не понял как там выдернуть PIDы<br /></p><div class="codebox"><pre><code>	
	Process, Exist, SomeProcess.exe
	pid = %ErrorLevel%
	msgbox, %pid%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[????????????]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42180</uri>
			</author>
			<updated>2021-12-01T11:09:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150872#p150872</id>
		</entry>
</feed>
