<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Подсчет количества нефоновых процессов]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17805&amp;type=atom" />
	<updated>2023-06-01T15:21:51Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=17805</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158414#p158414" />
			<content type="html"><![CDATA[<p>Да, все правильно, сорри. Просто он находил предыдущий процесс, который был без параметра и присваивал и выводил его. А другой процесс шел после него и он не присваивался и не выводился.</p>]]></content>
			<author>
				<name><![CDATA[stuermer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42062</uri>
			</author>
			<updated>2023-06-01T15:21:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158414#p158414</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158412#p158412" />
			<content type="html"><![CDATA[<p>ExecutablePath не должен содержать параметров, в CommandLine они должны быть, если были при запуске процесса.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-06-01T14:13:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158412#p158412</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158411#p158411" />
			<content type="html"><![CDATA[<p>По логике .CommandLine и .ExecutablePath выходит, что нет. В диспетчере задач в разделе Командная строка написан путь в кавычках и параметр. Но эти свойства содержат только сам путь в кавычках без параметра.</p>]]></content>
			<author>
				<name><![CDATA[stuermer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42062</uri>
			</author>
			<updated>2023-06-01T13:47:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158411#p158411</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158410#p158410" />
			<content type="html"><![CDATA[<p>Разве параметры не часть командной строки?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-06-01T11:53:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158410#p158410</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158409#p158409" />
			<content type="html"><![CDATA[<p>.CommandLine и .ExecutablePath содержат только командную строку в кавычках, а нужно найти и вывести с параметром после ковычек: /agent .<br />Как сделать? Перебрал почти все Properties Win32_Process class:</p><p><a href="https://learn.microsoft.com/uk-ua/windows/win32/cimwin32prov/win32-process">https://learn.microsoft.com/uk-ua/windo … 32-process</a></p><div class="codebox"><pre><code>For Prc in ComObjGet(&quot;winmgmts:&quot;).ExecQuery(&quot;Select * from Win32_Process&quot;)
	If InStr(Prc.ExecutablePath, &quot;player&quot;)
	{
		PrcPath := Prc.ExecutablePath ; .CommandLine
	}
MsgBox % &quot;&quot; PrcPath</code></pre></div>]]></content>
			<author>
				<name><![CDATA[stuermer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42062</uri>
			</author>
			<updated>2023-06-01T11:04:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158409#p158409</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158401#p158401" />
			<content type="html"><![CDATA[<p>Читайте <a href="https://www.autohotkey.com/docs/v1/Variables.htm">Variables and Expressions</a>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-31T16:52:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158401#p158401</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158397#p158397" />
			<content type="html"><![CDATA[<p>Подскажите, чего не работает? Хочу вывести командную строку процесса.<br /></p><div class="codebox"><pre><code>For Prc in ComObjGet(&quot;winmgmts:&quot;).ExecQuery(&quot;Select * from Win32_Process&quot;)
	If InStr(Prc.ExecutablePath, &quot;agent&quot;)
	{
		PrcID = Prc.ProcessID
		PrcPath = Prc.ExecutablePath
	}
MsgBox % &quot;&quot; PrcPath</code></pre></div><p>Выводит &quot;Prc.ExecutablePath&quot;</p>]]></content>
			<author>
				<name><![CDATA[stuermer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42062</uri>
			</author>
			<updated>2023-05-31T16:17:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158397#p158397</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158393#p158393" />
			<content type="html"><![CDATA[<p>Достаточно проверить на критичность. Если у программы Lingvo.exe	[16.2.2.133] снять 2 фоновых процесса вручную, то она продолжает работать без свернутых окон и без трея. При этом она нефоновая.</p>]]></content>
			<author>
				<name><![CDATA[stuermer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42062</uri>
			</author>
			<updated>2023-05-30T16:56:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158393#p158393</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158392#p158392" />
			<content type="html"><![CDATA[<p>Хотя решил проверить и оказалось, что не совсем так.<br />Вначале надо проверить, что процесс критичный/некритичный, а потом уже проверять все некритичные на видимое окно.<br /></p><div class="codebox"><pre><code>pid := 7300
hProcess := DllCall(&quot;OpenProcess&quot;, &quot;uint&quot;, 0x1000, &quot;int&quot;, 0, &quot;uint&quot;, pid, &quot;ptr&quot;)
DllCall(&quot;IsProcessCritical&quot;, &quot;ptr&quot;, hProcess, &quot;int*&quot;, bool)
DllCall(&quot;CloseHandle&quot;, &quot;ptr&quot;, hProcess)
msgbox % bool </code></pre></div><p>Кстати, после установки недокументированной RtlSetProcessIsCritical, при завершении процесса получаем BSOD.<br /><a href="https://www.codeproject.com/Articles/43405/Protecting-Your-Process-with-RtlSetProcessIsCriti">https://www.codeproject.com/Articles/43 … essIsCriti</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-05-29T13:22:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158392#p158392</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158391#p158391" />
			<content type="html"><![CDATA[<p>Проверяйте есть ли у процесса видимое окно - если есть, то процесс нефоновый.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-05-29T12:16:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158391#p158391</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158390#p158390" />
			<content type="html"><![CDATA[<p>Как это выгдядеть будет?<br />IsProcessCritical(Prc) не компилируется.</p>]]></content>
			<author>
				<name><![CDATA[stuermer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42062</uri>
			</author>
			<updated>2023-05-29T11:43:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158390#p158390</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158389#p158389" />
			<content type="html"><![CDATA[<p>Тут все просто.<br /><a href="https://devblogs.microsoft.com/oldnewthing/20171219-00/?p=97606">https://devblogs.microsoft.com/oldnewth … 0/?p=97606</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-05-29T10:08:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158389#p158389</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158388#p158388" />
			<content type="html"><![CDATA[<p>Фоновый процесс это процесс, который находится в разделе &quot;фоновые процессы&quot; в диспетчере задач. У него может быть &quot;тезка&quot; в разделе &quot;Приложения.&quot;</p>]]></content>
			<author>
				<name><![CDATA[stuermer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42062</uri>
			</author>
			<updated>2023-05-29T07:38:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158388#p158388</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158387#p158387" />
			<content type="html"><![CDATA[<p>Тогда всё упирается в понятие &quot;взаимодействие с пользователем&quot;. Настройки, на мой взгляд, те же команды. И если они отдаются в окне приложения, будь оно даже окно настроек, то есть ли принципиальная разница с командами в другом окне?</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2023-05-29T05:23:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158387#p158387</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подсчет количества нефоновых процессов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158386#p158386" />
			<content type="html"><![CDATA[<p>В этом случае он может быть и таким, и таким. Иконка, например, может использоваться только для вызова окна настроек.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-29T03:33:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158386#p158386</id>
		</entry>
</feed>
