<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=12637</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12637&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK:  Команда Process - узнать приоритет процесса по PID».]]></description>
		<lastBuildDate>Wed, 26 Apr 2017 04:40:55 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115334#p115334</link>
			<description><![CDATA[<p><span style="color: green"><strong>Indomito</strong><br />Замечание за избыточное цитирование. Убрано.</span></p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Wed, 26 Apr 2017 04:40:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115334#p115334</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115333#p115333</link>
			<description><![CDATA[<p><strong>Malcev</strong><br />1. Понятно, так и делаю.<br />2. Тоже понятно, просто забыл что DllCall пишет в A_LastError.<br />3. Это тоже понятно.</p><p>Спасибо за развёрнутый ответ.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Wed, 26 Apr 2017 04:35:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115333#p115333</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115330#p115330</link>
			<description><![CDATA[<p>Проверяйте наличие процесса перед OpenProcess.<br />Либо проверяйте A_LastError после OpenProcess.<br />Если обращение к GetPriorityClass возвращает 0, значит что-то пошло не так и надо смотреть A_LastError.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 26 Apr 2017 02:57:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115330#p115330</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115328#p115328</link>
			<description><![CDATA[<p><strong>Malcev</strong><br />А если процесса не существует/ ошибочный PID, ну всякое бывает, то какой код возврата в коде. </p><div class="codebox"><pre><code>PROCESS_QUERY_INFORMATION := 0x400
PID := 360
hProc := DllCall(&quot;OpenProcess&quot;, &quot;Uint&quot;, PROCESS_QUERY_INFORMATION, &quot;Int&quot;, 0, &quot;UInt&quot;, PID, &quot;Ptr&quot;)
Priority := DllCall(&quot;GetPriorityClass&quot;, &quot;Ptr&quot;, hProc)
DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, hProc)
msgbox % Priority</code></pre></div><p> Я про гарантированный код возврата, т.е. всегда <strong>False</strong>, т.е. <strong>0x0</strong>?</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Wed, 26 Apr 2017 02:20:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115328#p115328</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115325#p115325</link>
			<description><![CDATA[<div class="codebox"><pre><code>;0x100 - realtime
;0x80 - high
;0x8000 - above normal
;0x20 - normal
;0x4000 - below normal
;0x40 - low</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 25 Apr 2017 21:01:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115325#p115325</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115321#p115321</link>
			<description><![CDATA[<p>Коды возврата, словами не трудно расписать?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Tue, 25 Apr 2017 20:27:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115321#p115321</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115320#p115320</link>
			<description><![CDATA[<div class="codebox"><pre><code>PROCESS_QUERY_INFORMATION := 0x400
PID := 360
hProc := DllCall(&quot;OpenProcess&quot;, &quot;Uint&quot;, PROCESS_QUERY_INFORMATION, &quot;Int&quot;, 0, &quot;UInt&quot;, PID, &quot;Ptr&quot;)
Priority := DllCall(&quot;GetPriorityClass&quot;, &quot;Ptr&quot;, hProc)
DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, hProc)
msgbox % Priority</code></pre></div><p>Но если требуется процессы других пользователей открывать, то надо сперва повысить привилегии скрипта:<br /></p><div class="codebox"><pre><code>Process, Exist  ; sets ErrorLevel to the PID of this running script
; Get the handle of this script with PROCESS_QUERY_INFORMATION (0x0400)
h := DllCall(&quot;OpenProcess&quot;, &quot;UInt&quot;, 0x0400, &quot;Int&quot;, false, &quot;UInt&quot;, ErrorLevel, &quot;Ptr&quot;)
; Open an adjustable access token with this process (TOKEN_ADJUST_PRIVILEGES = 32)
DllCall(&quot;Advapi32.dll\OpenProcessToken&quot;, &quot;Ptr&quot;, h, &quot;UInt&quot;, 32, &quot;PtrP&quot;, t)
VarSetCapacity(ti, 16, 0)  ; structure of privileges
NumPut(1, ti, 0, &quot;UInt&quot;)  ; one entry in the privileges array...
; Retrieves the locally unique identifier of the debug privilege:
DllCall(&quot;Advapi32.dll\LookupPrivilegeValue&quot;, &quot;Ptr&quot;, 0, &quot;Str&quot;, &quot;SeDebugPrivilege&quot;, &quot;Int64P&quot;, luid)
NumPut(luid, ti, 4, &quot;Int64&quot;)
NumPut(2, ti, 12, &quot;UInt&quot;)  ; enable this privilege: SE_PRIVILEGE_ENABLED = 2
; Update the privileges of this process with the new access token:
r := DllCall(&quot;Advapi32.dll\AdjustTokenPrivileges&quot;, &quot;Ptr&quot;, t, &quot;Int&quot;, false, &quot;Ptr&quot;, &amp;ti, &quot;UInt&quot;, 0, &quot;Ptr&quot;, 0, &quot;Ptr&quot;, 0)
DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, t)  ; close this access token handle to save memory
DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, h)  ; close this process handle to save memory</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 25 Apr 2017 20:18:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115320#p115320</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115318#p115318</link>
			<description><![CDATA[<p>Примерчиком не поделишься?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Tue, 25 Apr 2017 20:02:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115318#p115318</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115309#p115309</link>
			<description><![CDATA[<p><a href="https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms683211(v=vs.85).aspx">https://msdn.microsoft.com/ru-ru/librar … s.85).aspx</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 25 Apr 2017 18:35:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115309#p115309</guid>
		</item>
		<item>
			<title><![CDATA[AHK:  Команда Process - узнать приоритет процесса по PID]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115305#p115305</link>
			<description><![CDATA[<p>Приветствую. </p><p>И так сабж.<br />Мне нужно узнать, а не поменять приоритет процесса по PID.</p><p>Команды <strong>Process</strong> и <strong>WinGet</strong> не выдают такой информации. Поиском пользовался.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Tue, 25 Apr 2017 17:49:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115305#p115305</guid>
		</item>
	</channel>
</rss>
