<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Завершение процесса explorer.exe (без перезапуска Проводника)]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=4006&amp;type=atom" />
	<updated>2009-12-21T15:35:25Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=4006</id>
		<entry>
			<title type="html"><![CDATA[AHK: Завершение процесса explorer.exe (без перезапуска Проводника)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=31670#p31670" />
			<content type="html"><![CDATA[<p>Если просто попытаться «прибить» процесс «explorer.exe» командой:<br /></p><div class="codebox"><pre><code>Process, Close, explorer.exe</code></pre></div><p>то «Программа входа в систему Windows NT» (%systemroot%\system32\winlogon.exe) перезапустит Проводник.</p><p>Чтобы предотвратить подобное поведение, нужно завершить процесс Проводника «explorer.exe» с кодом возврата «1». Сделать это можно посредством функции WinAPI <a href="http://msdn.microsoft.com/en-us/library/ms686714(VS.85).aspx">TerminateProcess</a>:<br /></p><div class="codebox"><pre><code>Process, Exist, Explorer.exe
PID := ErrorLevel 
h_process := DllCall(&quot;OpenProcess&quot;, UInt, 0x1, Int, 0, UInt, PID)   ; 0x1 — право доступа «PROCESS_TERMINATE»
DllCall(&quot;TerminateProcess&quot;, UInt, h_process, UInt, 1) 
DllCall(&quot;CloseHandle&quot;, UInt, h_process)</code></pre></div><p>Автор идеи — <strong>teadrinker</strong>.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2009-12-21T15:35:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=31670#p31670</id>
		</entry>
</feed>
