<?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="http://forum.script-coding.com/extern.php?action=feed&amp;tid=17199&amp;type=atom" />
	<updated>2022-06-21T11:33:02Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=17199</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Постоянное ожидание появления окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=153628#p153628" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong><br />Большое спасибо!: )</p>]]></content>
			<author>
				<name><![CDATA[denini]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42618</uri>
			</author>
			<updated>2022-06-21T11:33:02Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=153628#p153628</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Постоянное ожидание появления окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=153625#p153625" />
			<content type="html"><![CDATA[<p>Лучше вот так:</p><div class="codebox"><pre><code>SetTitleMatchMode, 2
App := &quot;Упаковать ahk_class Notepad ahk_exe notepad.exe&quot; ; Указать своё окно.

Loop{
 WinWait % App
 ToolTip, Окно открыто, -9999,-9999
 WinMove, 0, 0
 WinWaitClose % App
 ToolTip, % &quot;Окно закрыто: &quot; A_Index, -9999,-9999
}
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2022-06-20T15:38:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=153625#p153625</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Постоянное ожидание появления окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=153621#p153621" />
			<content type="html"><![CDATA[<p>Здравствуйте, я новичок в ahk. Помогите, пожалуйста, правильно написать скрипт.<br />У меня есть одно окошко, которое не запоминает позицию. Мне нужно каждый раз при его открытии двигать его. Я хотел, чтобы скрипт ждал его появление, сдвигал его, а потом ждал его закрытия. После же опять возвращался на стражу: )<br />Как я понял немного поискав, это возможно только с командой типа settimer, вот что получилось:<br /></p><div class="codebox"><pre><code>
#Persistent
#WinActivateForce

global
WinTitle := &quot;Тест&quot;
SetTimer, Alert1, 500
return

Alert1:
WinWait, %WinTitle%
IfWinNotActive
{
	WinActivate
	WinMove, -875, 0
}
else
	WinMove, -875, 0
WinWaitClose ; Ожидание закрытия окна, найденного WinWait
return
</code></pre></div><p>Или так не будет работать и нужно вместо строки <br /></p><div class="codebox"><pre><code>WinWait, %WinTitle%</code></pre></div><p>написать<br /></p><div class="codebox"><pre><code>IfWinNotExist, %WinTitle%
    return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[denini]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42618</uri>
			</author>
			<updated>2022-06-20T12:31:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=153621#p153621</id>
		</entry>
</feed>
