<?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=6052&amp;type=atom" />
	<updated>2013-03-10T10:00:12Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6052</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Открытие одного скрипа и закрытие других скриптов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70119#p70119" />
			<content type="html"><![CDATA[<p>Оставить запускной, остальные закрыть:</p><div class="codebox"><pre><code>#Persistent

PID:=DllCall(&quot;GetCurrentProcessId&quot;)
query:=&quot;SELECT Handle FROM Win32_Process WHERE Caption=&#039;AutoHotkey.exe&#039;&quot;

If (oWMI:=ComObjGet(&quot;winmgmts:&quot;).ExecQuery(query)).Count&gt;1
   For colItem In oWMI
      If colItem.Handle!=PID
         colItem.Terminate()

PID:=query:=oWMI:=&quot;&quot;

; ...</code></pre></div><p>Закрыть все:</p><div class="codebox"><pre><code>query:=&quot;SELECT Handle FROM Win32_Process WHERE Caption=&#039;AutoHotkey.exe&#039;&quot;

For colItem In ComObjGet(&quot;winmgmts:&quot;).ExecQuery(query)
   colItem.Terminate()</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2013-03-10T10:00:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70119#p70119</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Открытие одного скрипа и закрытие других скриптов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70114#p70114" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>VovanKaban пишет:</cite><blockquote><p>Или может есть команда которая завершает процесс, типа taskkill</p></blockquote></div><p>Ну да, есть команда Process. <a href="http://www.script-coding.com/AutoHotkey/Process.html">http://www.script-coding.com/AutoHotkey/Process.html</a></p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2013-03-10T07:55:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70114#p70114</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Открытие одного скрипа и закрытие других скриптов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70111#p70111" />
			<content type="html"><![CDATA[<p>Доброго времени суток!<br />&nbsp; &nbsp; &nbsp;Подскажите, как&nbsp; завершить другие скрипты ahk т.е. только один скрипт открывается и завершаются другие скрипты ahk, не важно сколько открыто закрываются все(или хотябы один)<br />Названия скриптов которые нужно закрыть, зарание не известны.<br />Или может есть команда которая завершает процесс, типа taskkill<br />Или может по маске *.ahk</p><br /><p><em>Р.S. Статья <a href="http://forum.script-coding.com/viewtopic.php?id=125">AHK: Остановка одного скрипта из тела другого</a>, мне не помогла, т.к. там скрипты завершаются запуском одного и завершением другого скрипта.</em></p><p>Заранее благодарю, за предоставление ответы!</p>]]></content>
			<author>
				<name><![CDATA[VovanKaban]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28345</uri>
			</author>
			<updated>2013-03-10T06:51:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70111#p70111</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Открытие одного скрипа и закрытие других скриптов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50177#p50177" />
			<content type="html"><![CDATA[<p>Grey, Огромное спасибо, все как надо заработало!!!:):):)</p>]]></content>
			<author>
				<name><![CDATA[Bruse81]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27086</uri>
			</author>
			<updated>2011-07-25T14:36:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50177#p50177</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Открытие одного скрипа и закрытие других скриптов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50157#p50157" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>DetectHiddenWindows, On
F1::
   Run, %A_WorkingDir%\Script1.ahk
   Sleep, 500
   Run, C:\Program Files\Script2.ahk ; полный путь задаётся если скипт для запуска лежит не там же где тот, что запускает
   Sleep, 500
   WinClose, %A_WorkingDir%\Script3.ahk ahk_class AutoHotkey
   Sleep, 500
   WinClose, C:\Program Files\Script4.ahk ahk_class AutoHotkey
   Return</code></pre></div><p><a href="http://www.script-coding.com/AutoHotkey/Variables.1.0.46.07.html#A_WorkingDir">%A_WorkingDir%</a>, %A_ScriptDir%.</p>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-07-25T01:45:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50157#p50157</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Открытие одного скрипа и закрытие других скриптов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50154#p50154" />
			<content type="html"><![CDATA[<p>Доброго времени суток!<br />Подскажите, как открыть определенный скрипт, например Script1 и одновременно завершить другие, Script2, Script3, Script4 и.т.д., и назначить все управление на клавишу F1., т.е. только один скрипт открывается и завершаются другие скрипты, не важно сколько открыто и все управление назначить в третьем (управляющим) скрипте на кнопку F1.<br />Р.S. Статья <a href="http://forum.script-coding.com/viewtopic.php?id=125">AHK: Остановка одного скрипта из тела другого</a>, мне не помогла, т.к. там скрипты завершаются запуском одного и завершением другого скрипта, а мне надо назначить на определенную клавишу.</p><p>Заранее благодарю, за предоставление ответы! <img src="//forum.script-coding.com/img/smilies/cool.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Bruse81]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27086</uri>
			</author>
			<updated>2011-07-24T18:56:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50154#p50154</id>
		</entry>
</feed>
