<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Определение PID фоновых процессов с одинаковым именем]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=16773</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16773&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Определение PID фоновых процессов с одинаковым именем».]]></description>
		<lastBuildDate>Wed, 01 Dec 2021 19:03:54 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Определение PID фоновых процессов с одинаковым именем]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150880#p150880</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Ну это то что нужно без смс и регистраций. Огромное спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (Turuan)]]></author>
			<pubDate>Wed, 01 Dec 2021 19:03:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150880#p150880</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определение PID фоновых процессов с одинаковым именем]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150873#p150873</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 01 Dec 2021 14:12:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150873#p150873</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Определение PID фоновых процессов с одинаковым именем]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150872#p150872</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (????????????)]]></author>
			<pubDate>Wed, 01 Dec 2021 11:09:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150872#p150872</guid>
		</item>
	</channel>
</rss>
