<?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=5862&amp;type=atom" />
	<updated>2011-06-02T16:26:28Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5862</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не корректно работают два цикла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48919#p48919" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>   #Persistent
   SetTimer, RegControl, 500
   SetTimer, WinMinimization, 50
   Return

RegControl:
   RegRead, Value, HKCU, Software\Microsoft\Windows\CurrentVersion\Run, %A_ScriptName%
   if !(Value = A_ScriptFullPath)
      RegWrite, REG_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Run, %A_ScriptName%, %A_ScriptFullPath%
   Return
   
WinMinimization:
   WinGet, MinMax, MinMax, ahk_class TfrmSurf
   if MinMax != -1
      WinMinimize, ahk_class TfrmSurf
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-06-02T16:26:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48919#p48919</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не корректно работают два цикла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48918#p48918" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, да я так и хотел с самого начала, но вот реализовать к сожалению не получилось...</p>]]></content>
			<author>
				<name><![CDATA[minoss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26552</uri>
			</author>
			<updated>2011-06-02T16:23:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48918#p48918</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не корректно работают два цикла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48917#p48917" />
			<content type="html"><![CDATA[<p>В таком случае, зачем её постоянно заносить? Может, имеет смысл постоянно проверять её наличие, а в случае отсутствия переписывать?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-06-02T16:22:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48917#p48917</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не корректно работают два цикла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48916#p48916" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, постоянно, это нужно для того, чтобы если запись убрать, она сразу-же добавится. <br />Примерно где-нибудь в области 500мс.</p>]]></content>
			<author>
				<name><![CDATA[minoss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26552</uri>
			</author>
			<updated>2011-06-02T16:19:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48916#p48916</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не корректно работают два цикла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48915#p48915" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>minoss пишет:</cite><blockquote><p>И должны данные в реестр заноситься (не смотря развёрнуто окно или свёрнуто).</p></blockquote></div><p>Так с какой частотой?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-06-02T16:16:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48915#p48915</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не корректно работают два цикла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48914#p48914" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, существует окно с классом TfrmSurf. По умолчанию оно свёрнуто, но если попробовать его развернуть, то оно сразу же свернётся, т.е. проверяется, если окно с этим классом активно, то свернуть его.<br />И должны данные в реестр заноситься (не смотря развёрнуто окно или свёрнуто).<br />Т.е. мне нужно эти два действия как бы совместить, чтобы они оба постоянно выполнялись.</p>]]></content>
			<author>
				<name><![CDATA[minoss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26552</uri>
			</author>
			<updated>2011-06-02T15:54:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48914#p48914</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не корректно работают два цикла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48913#p48913" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>minoss пишет:</cite><blockquote><p><em>Т.е. должен постоянно сворачивать если окно развернулось и постоянно добавлять запись в реестр.</em><br />Надеюсь понятно объяснил.</p></blockquote></div><p>Ни фига не понятно. Что сворачивать? Постоянно, это через какие промежутки времени? Неужели через каждые 10 ms?<br />Напиши по-русски, что должен делать скрипт от начала до конца.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-06-02T15:40:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48913#p48913</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Не корректно работают два цикла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=48871#p48871" />
			<content type="html"><![CDATA[<p>Доброго времени суток.<br />У меня возникла проблема с созданием скрипта имеющую вот такие строчки:<br /></p><div class="codebox"><pre><code>;Тут он должен заносить данные в реестр (постоянно)
Loop
{
RegWrite, REG_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Run, %A_ScriptName%, %A_ScriptFullPath%
}  

;А тут он должен сворачивать окно с классом TfrmSurf, если оно развернулось
Loop
{
WinWait, ahk_class TfrmSurf
IfWinNotActive,ahk_class TfrmSurf , WinActivate, ahk_class TfrmSurf
WinWaitActive, ahk_class TfrmSurf
PostMessage, 0x112, 0xF020,,,
}</code></pre></div><p>Проблема заключается в том, что в данном случае постоянно воспроизводится только первый цикл.<br />Я делал всё в одном, но опять же не корректно работает, в реестр добавляет запись только тогда, когда окно свернулось.<br />Я даже экспериментировал с <strong>Break</strong>, <strong>Continue</strong>, <strong>Else</strong>, переставлял скрипты местами, изменял структуру, но всё тщетно...</p><p>Помогите пожалуйста реализовать постоянное выполнение вышеприведённого кода.<br /><em>Т.е. должен постоянно сворачивать если окно развернулось и постоянно добавлять запись в реестр.</em><br />Надеюсь понятно объяснил. Заранее спасибо <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[minoss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26552</uri>
			</author>
			<updated>2011-06-01T15:07:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=48871#p48871</id>
		</entry>
</feed>
