<?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=7536&amp;type=atom" />
	<updated>2012-09-06T22:10:06Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7536</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63597#p63597" />
			<content type="html"><![CDATA[<p>Не очень хорошо получается при таком раскладе, что при нажатии на кнопку &quot;Отмена&quot; скрипт пропускает уничтожение 2го окна и активацию главного.<br />Так будет лучше:</p><div class="codebox"><pre><code>Gui, +HWNDguiHWND +owner
Gui, Add, Button, w111 h111 gOK, OK
Gui, Show, w802 h600
Return
OK:
WinGetPos , xpos, ypos, , , ahk_id %guiHWND%
xpos := (xpos+176)
ypos := (ypos+280)
Gui +Disabled
Gui, 2:+owner +HwndGui2
Gui, 2:Add, Edit, R1 x5 x5 w362 vclass ReadOnly -Background Section
Gui, 2:Add, Button, w50 xp+380 yp hp, OK
Gui, 2:Add, Edit, R1 w362 xs ys+36 vtitle ReadOnly -Background
Gui, 2:Add, Button, w50 xp+380 yp hp, OK
Gui, 2:Add, Button,  w80 h27 hp yp+36 wp+20 xp-20 gCancelWindowSelect, Отмена
Gui, 2:+AlwaysOnTop -Border +ToolWindow
Gui, 2:Font, s8 italic, Arial
Gui, 2:Color, B0C4DE
Gui, 2:Add, Text, xs+86 ys+66 Center, Активируйте нужное окно`rи выберите один из вариантов
Gui, 2:Show,  h110 w450 x%xpos% y%ypos%
Loop
{
sleep 100
if CancelWindowSelect = 1
   break
if (Gui2 = WinActive(&quot;A&quot;))
  Continue
WinGetTitle, title, A
WinGetClass, class, A
GuiControl, 2:, title, %title%
GuiControl, 2:, class, ahk_class %class%
}
CancelWindowSelect =
Gui 1:-Disabled
Gui, 2:Destroy
Gui, Show
Return
CancelWindowSelect:
CancelWindowSelect = 1
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2012-09-06T22:10:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63597#p63597</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63595#p63595" />
			<content type="html"><![CDATA[<p>Irbis</p><p>Спасибо! Я так и поступил, правда очень долго думал.</p><p>WinGet, ID , ID, A<br />if ID = %guiHWND%<br />Return</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2012-09-06T21:48:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63595#p63595</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63594#p63594" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Только вот не понятно как я собрался сохранять параметры нужного окна, если в момент нажатия кнопки активным станет скрипт <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /> <img src="//forum.script-coding.com/img/smilies/roll.png" width="15" height="15" /></p></blockquote></div><p>Наверное, нужно сделать так, чтобы скрипт не обрабатывал параметры, когда скрипт становится активен?<br />При создании окна #2 cохраняем его id в переменную Gui2:<br /></p><div class="codebox"><pre><code>...
Gui, 2:+owner +HwndGui2
...</code></pre></div><p>Затем в цикле &quot;извращённого решения (с)&quot; сначала делаем проверку, а не скрипт ли сейчас активен:<br /></p><div class="codebox"><pre><code>; ...
Loop
{
id:=WinActive(&quot;A&quot;)
if (id = Gui2)
  Continue
WinGetTitle, title, A
WinGetClass, class, A
; Далее по тексту</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2012-09-06T21:43:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63594#p63594</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63593#p63593" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>OFF: Форматирование кода отступами вы не используете с целью «повышения порога вхождения» для отвечающих?</p></blockquote></div><p>Как то не думал об этом, мне так удобнее или проще. Исправлюсь.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2012-09-06T21:00:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63593#p63593</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63592#p63592" />
			<content type="html"><![CDATA[<p>Только вот не понятно как я собрался сохранять параметры нужного окна, если в момент нажатия кнопки активным станет скрипт <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /> <img src="//forum.script-coding.com/img/smilies/roll.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2012-09-06T20:54:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63592#p63592</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63591#p63591" />
			<content type="html"><![CDATA[<p>OFF: Форматирование кода отступами вы не используете с целью «повышения порога вхождения» для отвечающих?</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-09-06T20:53:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63591#p63591</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63590#p63590" />
			<content type="html"><![CDATA[<p>Извращённое решение<br /></p><div class="codebox"><pre><code>Gui, +HWNDguiHWND +owner
Gui, Add, Button, w111 h111 gOK, OK
Gui, Show, w802 h600
Return
OK:
WinGetPos , xpos, ypos, , , ahk_id %guiHWND%
xpos := (xpos+176)
ypos := (ypos+280)
Gui +Disabled
Gui, 2:+owner
Gui, 2:Add, Edit, R1 x5 x5 w362 vclass ReadOnly -Background Section
Gui, 2:Add, Button, w50 xp+380 yp hp, OK
Gui, 2:Add, Edit, R1 w362 xs ys+36 vtitle ReadOnly -Background
Gui, 2:Add, Button, w50 xp+380 yp hp, OK
Gui, 2:Add, Button,  w80 h27 hp yp+36 wp+20 xp-20 gCancelWindowSelect, Отмена
Gui, 2:+AlwaysOnTop -Border +ToolWindow
Gui, 2:Font, s8 italic, Arial
Gui, 2:Color, B0C4DE
Gui, 2:Add, Text, xs+86 ys+66 Center, Активируйте нужное окно`rи выберите один из вариантов
Gui, 2:Show,  h110 w450 x%xpos% y%ypos%
Loop
{  
WinGetTitle, title, A
WinGetClass, class, A
GuiControl, 2:, title, %title%
GuiControl, 2:, class, ahk_class %class%
if CancelWindowSelect = 1
{ 
CancelWindowSelect =
Gui 1:-Disabled
Gui, 2:Destroy
Gui, Show
break
}
}
Return
CancelWindowSelect:
CancelWindowSelect = 1
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2012-09-06T20:51:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63590#p63590</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63589#p63589" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Clicking on a control while its g-label is already running from a prior click will have no effect and the event is discarded. To prevent this, use Critical as the subroutine&#039;s first line (however, this will also buffer/defer other threads such as the press of a hotkey).</p></blockquote></div><p>Бесконечные циклы это слишком надёжное решение.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-09-06T20:49:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63589#p63589</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63588#p63588" />
			<content type="html"><![CDATA[<p>Спасибо! А почему в таком варианте, второе окно запускается только один раз, то бишь после закрытия не появляется снова по кнопке?</p><div class="codebox"><pre><code>Gui, +HWNDguiHWND +owner
Gui, Add, Button, w111 h111 gOK, OK
Gui, Show, w802 h600
Return
OK:
WinGetPos , xpos, ypos, , , ahk_id %guiHWND%
xpos := (xpos+176)
ypos := (ypos+280)
Gui +Disabled
Gui, 2:+owner
Gui, 2:Add, Edit, R1 x5 x5 w362 vclass ReadOnly -Background Section
Gui, 2:Add, Button, w50 xp+380 yp hp, OK
Gui, 2:Add, Edit, R1 w362 xs ys+36 vtitle ReadOnly -Background
Gui, 2:Add, Button, w50 xp+380 yp hp, OK
Gui, 2:Add, Button,  w80 h27 hp yp+36 wp+20 xp-20 gCancelWindowSelect, Отмена
Gui, 2:+AlwaysOnTop -Border +ToolWindow
Gui, 2:Font, s8 italic, Arial
Gui, 2:Color, B0C4DE
Gui, 2:Add, Text, xs+86 ys+66 Center, Активируйте нужное окно`rи выберите один из вариантов
Gui, 2:Show,  h110 w450 x%xpos% y%ypos%
Loop  
{  
WinGetTitle, title, A
WinGetClass, class, A
GuiControl, 2:, title, %title%
GuiControl, 2:, class, ahk_class %class%
}
Return
CancelWindowSelect:
Gui 1:-Disabled
Gui, 2:Destroy
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2012-09-06T20:44:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63588#p63588</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63587#p63587" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Gui, 1:+HWNDguiHWND
Gui, 1:Add, Button, w111 h111 gOK, OK
Gui, 1:Show, w802 h600
Return

OK:
    WinGetPos , xpos, ypos, , , ahk_id %guiHWND%
    xpos := (xpos+176)
    ypos := (ypos+280)
    Gui, 1:+Disabled
    Gui, 2:+owner
    Gui, 2:Add, Edit, R1 x5 x5 w362 ReadOnly -Background Section
    Gui, 2:Add, Button, w50 xp+380 yp hp, OK
    Gui, 2:Add, Edit, R1 w362 xs ys+36 ReadOnly -Background
    Gui, 2:Add, Button, w50 xp+380 yp hp, OK
    Gui, 2:Add, Button,  w80 h27 hp yp+36 wp+20 xp-20 gCancelWindowSelect, Отмена
    Gui, 2:+AlwaysOnTop -Border +ToolWindow
    Gui, 2:Font, s8 italic, Arial
    Gui, 2:Color, B0C4DE
    Gui, 2:Add, Text, xs+86 ys+66 Center, Активируйте нужное окно`rи выберите один из вариантов
    Gui, 2:Show,  h110 w450 x%xpos% y%ypos%
    Return

CancelWindowSelect:
    Gui, 1:-Disabled
    Gui, 2:Destroy
    Return
Esc::Exitapp</code></pre></div><p>CancelWindowSelect выполняется в потоке Gui, 2:</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-09-06T20:36:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63587#p63587</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63586#p63586" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
; ...
; ...
CancelWindowSelect:
Gui 1:-Disabled
; ...
; ...</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2012-09-06T20:35:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63586#p63586</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Зависимое окно, блокирует владельца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63584#p63584" />
			<content type="html"><![CDATA[<p>Ничего не могу понять. Всё по справке делаю, но после удаления второго окна по кнопке отмена, главное сворачивается, да ещё и остаётся блокированным!?</p><div class="codebox"><pre><code>Gui, +HWNDguiHWND
Gui, Add, Button, w111 h111 gOK, OK
Gui, Show, w802 h600
Return
OK:
WinGetPos , xpos, ypos, , , ahk_id %guiHWND%
xpos := (xpos+176)
ypos := (ypos+280)
Gui +Disabled
Gui, 2:+owner
Gui, 2:Add, Edit, R1 x5 x5 w362 ReadOnly -Background Section
Gui, 2:Add, Button, w50 xp+380 yp hp, OK
Gui, 2:Add, Edit, R1 w362 xs ys+36 ReadOnly -Background
Gui, 2:Add, Button, w50 xp+380 yp hp, OK
Gui, 2:Add, Button,  w80 h27 hp yp+36 wp+20 xp-20 gCancelWindowSelect, Отмена
Gui, 2:+AlwaysOnTop -Border +ToolWindow
Gui, 2:Font, s8 italic, Arial
Gui, 2:Color, B0C4DE
Gui, 2:Add, Text, xs+86 ys+66 Center, Активируйте нужное окно`rи выберите один из вариантов
Gui, 2:Show,  h110 w450 x%xpos% y%ypos%
Return
CancelWindowSelect:
Gui -Disabled 
Gui, 2:Destroy
Return
Esc::Exitapp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2012-09-06T20:18:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63584#p63584</id>
		</entry>
</feed>
