<?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=6984&amp;type=atom" />
	<updated>2012-03-22T17:07:55Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6984</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ограничения в работе скрипта]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=58264#p58264" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>App:=&quot;notepad.exe&quot;, AppCount:=3
Query:=&quot;select ProcessId from Win32_Process where Name=&#039;&quot;App &quot;&#039;&quot;
MsgBox, 262144, % &quot; &quot;, Run 10 notepad applications, 1
Loop, 10
{
   Run, notepad.exe, % A_WinDir &quot;\System32&quot;,, WinPID
   WinWaitActive, % &quot;ahk_pid&quot;WinPID
   ControlSendRaw, Edit1, % &quot;Instance: &quot;A_Index
                 . &quot;`n`n&quot;A_Hour &quot;:&quot;A_Min &quot;.&quot;A_Sec
                 , % &quot;ahk_pid&quot;WinPID
}
MsgBox, 262144, % &quot; &quot;, Close all but the first tree., 1
For Key In ComObjGet(&quot;winmgmts:&quot;).ExecQuery(Query)
  If % A_Index&gt;AppCount
  {
     WinActivate, % &quot;ahk_pid&quot;Key.ProcessId
     ControlSendRaw, Edit1
                   , % &quot;`n`nClose instance: &quot;A_Index
                   , % &quot;ahk_pid&quot;Key.ProcessId
     WinClose, % &quot;ahk_pid&quot;Key.ProcessId
     ControlClick, Button2, ahk_class #32770,,, 2
  }
MsgBox, 262144, % &quot; &quot;, Done!, 1
Sleep, 1000
For Key In ComObjGet(&quot;winmgmts:&quot;).ExecQuery(Query)
   {
      WinClose, % &quot;ahk_pid&quot;Key.ProcessId
      ControlClick, Button2, ahk_class #32770,,, 2
   }
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-03-22T17:07:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=58264#p58264</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ограничения в работе скрипта]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=58252#p58252" />
			<content type="html"><![CDATA[<p>Ну скажем через другой скрипт, т.е. считать запуски правда надо использовать глобальные переменные, но я не знаю точно как, но знаю что можно.</p><p>Или же создать переменную окружения и туда писать число запусков и сравнивать уже в самом стартующем скрипте... вариантов много, а начальных условий мало.<br /> <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Indomito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27285</uri>
			</author>
			<updated>2012-03-22T14:26:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=58252#p58252</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ограничения в работе скрипта]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=58251#p58251" />
			<content type="html"><![CDATA[<p>Можно поподробнее о &quot;программно&quot;?</p>]]></content>
			<author>
				<name><![CDATA[vezderegit@bk.ru]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26789</uri>
			</author>
			<updated>2012-03-22T14:20:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=58251#p58251</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ограничения в работе скрипта]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=58250#p58250" />
			<content type="html"><![CDATA[<p>Можно.<br />Директива <strong>#SingleInstance</strong> - проверяет/ограничивает запуск дубликатов<br />Ну, а про число запусков, думаю это можно сделать программно.</p>]]></content>
			<author>
				<name><![CDATA[Indomito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27285</uri>
			</author>
			<updated>2012-03-22T14:09:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=58250#p58250</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Ограничения в работе скрипта]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=58248#p58248" />
			<content type="html"><![CDATA[<p>Возможно ли сделать какие то ограничения на работу скрипта? Временные или на количество запусков вообще, или количество запусков одновременных?я</p>]]></content>
			<author>
				<name><![CDATA[vezderegit@bk.ru]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26789</uri>
			</author>
			<updated>2012-03-22T13:42:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=58248#p58248</id>
		</entry>
</feed>
