<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Реакция на закрытие окна taskmrg.exe]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=15129</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15129&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Реакция на закрытие окна taskmrg.exe».]]></description>
		<lastBuildDate>Thu, 16 Jan 2020 11:35:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Реакция на закрытие окна taskmrg.exe]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137270#p137270</link>
			<description><![CDATA[<p>С 0.5 работает.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 16 Jan 2020 11:35:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137270#p137270</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Реакция на закрытие окна taskmrg.exe]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137267#p137267</link>
			<description><![CDATA[<p>Да, лучше ждать закрытия окна, я просто хотел вспомнить мониторинг процессов. Если перестаёт, можно период проверки уменьшить здесь: Within 1, можно .5 поставить.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 16 Jan 2020 07:14:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137267#p137267</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Реакция на закрытие окна taskmrg.exe]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137265#p137265</link>
			<description><![CDATA[<p>Не проще ли?<br /></p><div class="codebox"><pre><code>WinWaitClose, ahk_exe taskmgr.exe
loop
   RunWait, taskmgr.exe</code></pre></div><p><strong>teadrinker</strong>, У меня на Win-10 твой код не работает.<br />Если при открытии сразу же окно закрывать, то первые 3-5 раз запускает заново, потом перестает.<br />Висит на <br /></p><div class="quotebox"><blockquote><p>005: Run,taskmgr.exe<br />006: } (124.97)</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 16 Jan 2020 02:46:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137265#p137265</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Реакция на закрытие окна taskmrg.exe]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137264#p137264</link>
			<description><![CDATA[<p>teadrinker, ясно.<br />Спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (ОсиповаТатьяна)]]></author>
			<pubDate>Wed, 15 Jan 2020 23:52:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137264#p137264</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Реакция на закрытие окна taskmrg.exe]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137258#p137258</link>
			<description><![CDATA[<p>Попробуйте такой код:<br /></p><div class="codebox"><pre><code>#Persistent
PM := new ProcessMonitoring(, Func(&quot;OnTaskmgrClose&quot;), &quot;taskmgr.exe&quot;)

OnTaskmgrClose(name, PID, cmd) {
   Run, taskmgr.exe
}

class ProcessMonitoring
{
   __New(UserFuncOnCreate := &quot;&quot;, UserFuncOnDelete := &quot;&quot;, singleProcess := &quot;&quot;) {
      command := &quot;Within 1 Where TargetInstance ISA &#039;Win32_Process&#039;&quot;
               . (singleProcess ? &quot; And TargetInstance.Name = &#039;&quot; . singleProcess . &quot;&#039;&quot; : &quot;&quot;)
      this.WMI := ComObjGet(&quot;winmgmts:&quot;)
      if UserFuncOnCreate {
         this.createSink := ComObjCreate(&quot;WbemScripting.SWbemSink&quot;)
         ComObjConnect( this.createSink, new this.EventSink(UserFuncOnCreate) )
         this.WMI.ExecNotificationQueryAsync(this.createSink, &quot;select * from __InstanceCreationEvent &quot; . command)
      }
      if UserFuncOnDelete {
         this.deleteSink := ComObjCreate(&quot;WbemScripting.SWbemSink&quot;)
         ComObjConnect( this.deleteSink, new this.EventSink(UserFuncOnDelete) )
         this.WMI.ExecNotificationQueryAsync(this.deleteSink, &quot;select * from __InstanceDeletionEvent &quot; . command)
      }
   }
   
   class EventSink
   {
      __New(UserFunc) {
         this.UserFunc := UserFunc
      }
      
      OnObjectReady(params*) {
         Process := params[1].TargetInstance
         name := Process.Name
         PID := Process.ProcessID
         cmd := Process.CommandLine
         timer := this.UserFunc.Bind(name, PID, cmd)
         SetTimer, % timer, -10
      }
   }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 14 Jan 2020 21:49:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137258#p137258</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Реакция на закрытие окна taskmrg.exe]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137257#p137257</link>
			<description><![CDATA[<p>Это такое условие, проверяющее существование окна. Окно можно идентифицировать разными способами. Почитайте в документации.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Tue, 14 Jan 2020 20:23:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137257#p137257</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Реакция на закрытие окна taskmrg.exe]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137256#p137256</link>
			<description><![CDATA[<p>А как это скриптом сделать ?</p>]]></description>
			<author><![CDATA[null@example.com (ОсиповаТатьяна)]]></author>
			<pubDate>Tue, 14 Jan 2020 20:19:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137256#p137256</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Реакция на закрытие окна taskmrg.exe]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137255#p137255</link>
			<description><![CDATA[<p>Можно проверять периодически командой <em>WinExist() / IfWin[Not]Exist</em>.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Tue, 14 Jan 2020 20:10:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137255#p137255</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Реакция на закрытие окна taskmrg.exe]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=137254#p137254</link>
			<description><![CDATA[<p>Добрый вечер.<br />Помогите решить проблему.</p><p>Как скриптом AHK автоматически заново запустить процесс taskmrg.exe (окно диспетчера задач), если этот диспетчер задач будет кем-то случайно закрыт или будет закрыт по таймеру другой программой.<br />То есть если процесс taskmrg.exe - исчезнет, то как его автоматически запустить вновь - скриптом AHK, сидящим в трее ?</p>]]></description>
			<author><![CDATA[null@example.com (ОсиповаТатьяна)]]></author>
			<pubDate>Tue, 14 Jan 2020 18:55:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=137254#p137254</guid>
		</item>
	</channel>
</rss>
