<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: ошибка при повтороном вызове Gui]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11777&amp;type=atom" />
	<updated>2021-07-13T17:26:35Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11777</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: ошибка при повтороном вызове Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148947#p148947" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong><br />О, спасибо большое!</p>]]></content>
			<author>
				<name><![CDATA[~incognito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41862</uri>
			</author>
			<updated>2021-07-13T17:26:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148947#p148947</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: ошибка при повтороном вызове Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148946#p148946" />
			<content type="html"><![CDATA[<p>При закрытии окошка - удалять его, вот и всё решение проблемы.<br />AHK ругается на использовании одинаковых переменных при создании окон.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-07-13T17:23:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148946#p148946</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: ошибка при повтороном вызове Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148945#p148945" />
			<content type="html"><![CDATA[<p><strong>__Михаил__</strong><br />Создаётся новое окно, всё в этом коде.<br />Окно в окне - как сделать так, чтобы он не создавал новое окно?<br />Как я понял проблема именно в том, что создаётся новое окно.</p><p>Upd: Вот примерный код - то, что у меня получилось:<br /></p><div class="codebox"><pre><code>Gui, Add, Button, w60 h60 gButt1
Gui, Show, w120 h120, Test
return
Butt1:
Gui, 2:Add, Picture, x8 y0 w64 h64, icon.png
Gui, 2:Add, Edit , x101 y3 w375 h62 vEd1

Gui, 2:Show, w488 h71, Sniper Rifle
return
2GuiClose:
Gui, submit
return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[~incognito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41862</uri>
			</author>
			<updated>2021-07-13T16:47:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148945#p148945</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: ошибка при повтороном вызове Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148944#p148944" />
			<content type="html"><![CDATA[<p>Для начала приведите полный код, как выводите повторно окно.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-07-13T16:10:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148944#p148944</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: ошибка при повтороном вызове Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=148943#p148943" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> У меня похожая проблема, но решается наверное чуть по другому, что я не могу понять.<br /></p><div class="codebox"><pre><code>Butt3:
Gui, 4:Add, Picture, x8 y0 w64 h64, иконки\SNIPERicon.png
Gui, 4:Add, Edit , x101 y3 w375 h62 vEd1

Gui, 4:Show, w488 h71, Sniper Rifle
return
4GuiClose:
Gui, submit
return</code></pre></div><p>Мне нужно чтобы при открытии снова 4 гуи - ошибка не выходила.</p>]]></content>
			<author>
				<name><![CDATA[~incognito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41862</uri>
			</author>
			<updated>2021-07-13T15:32:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=148943#p148943</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: ошибка при повтороном вызове Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105691#p105691" />
			<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>2016-06-29T14:31:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105691#p105691</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: ошибка при повтороном вызове Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105689#p105689" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, благодарю! А конкретно у меня в чём ошибка? Первый проход же корректно проходит.</p>]]></content>
			<author>
				<name><![CDATA[laburj]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25900</uri>
			</author>
			<updated>2016-06-29T14:05:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105689#p105689</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: ошибка при повтороном вызове Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105688#p105688" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Gui, Add, Button,, OK
Gui, Show, w300 h300
Return

ButtonOK:
Gui, Submit
Sleep, 1000
Gui, Show
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-06-29T13:47:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105688#p105688</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: ошибка при повтороном вызове Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105687#p105687" />
			<content type="html"><![CDATA[<p>Есть идея реализовать скрипт для ведения хронометража - каждый определённый промежуток времени выскакивает окно, в котором следует зафиксировать то, чем ты занимаешься. Информация сохраняется в текстовом файле в виде, удобном для экспорта в excel таблицу.</p><p>Сейчас столкнулся с тем, что когда повторяется цикл - скрипт выдаёт ошибку:<br /></p><div class="codebox"><pre><code>Error:  The same variable cannot be used for more than one control.

Specifically: vName

	Line#
	002: WinGetTitle,title_of_active_task,A
---&gt;	006: Gui,Add,Edit,vName
	007: Gui,Add,Button,Default w245 xs,OK
</code></pre></div><p>сам скрипт:<br /></p><div class="codebox"><pre><code>
chrono_loop:  ; метка
WinGettitle, title_of_active_task, A
;msgbox %title_of_active_task%

Gui, Add, Edit, vName w500,
Gui, Add, Button, Default w245 xs, OK
Gui, Add, Button, w245 xp+255, Cancel
Gui, Show,, Чем сейчас занимаешься?..
return

ButtonOK:
FormatTime, TimeString, ,yyyy-MM-dd HH:mm ;2016-03-10 11:55
Gui, Submit  ; Save the input from the user to each control&#039;s associated variable.
;MsgBox You entered &quot;%Name%&quot;.
FileAppend, %TimeString%;%Name%;%title_of_active_task%`n, d:\chronom.txt
sleep 5000 ;
goto, chrono_loop ; возврат к метке

GuiClose:
ButtonCancel:
GuiEscape:
sleep 5000 ;
goto, chrono_loop ; возврат к метке
</code></pre></div><p>Подкорректируйте пожалуйста.</p>]]></content>
			<author>
				<name><![CDATA[laburj]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25900</uri>
			</author>
			<updated>2016-06-29T13:22:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105687#p105687</id>
		</entry>
</feed>
