<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: WinGetTitle - Запрет на получение названия всех окон Gui]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15802&amp;type=atom" />
	<updated>2020-11-05T15:28:47Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15802</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: WinGetTitle - Запрет на получение названия всех окон Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143174#p143174" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong> Спасибо, разобрался.</p>]]></content>
			<author>
				<name><![CDATA[Botsy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41069</uri>
			</author>
			<updated>2020-11-05T15:28:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143174#p143174</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: WinGetTitle - Запрет на получение названия всех окон Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143173#p143173" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Botsy пишет:</cite><blockquote><p>Решил через класс</p></blockquote></div><p>Под это любой другой скрипт подойдёт.</p><p>Тут отсечено главное окно. <br /></p><div class="codebox"><pre><code>
CurPID := DllCall(&quot;GetCurrentProcessId&quot;)
Gui, +HWNDhMain
Gui, Show, x222 w222 h222, Main
Gui, New 
Gui, Show, x444 w222 h222
Gui, New 
Gui, Show, x666 w222 h222

1:: 
	WinGet, PID, PID, A 
	MsgBox % (PID = CurPID) &amp;&amp; (hMain != WinExist(&quot;A&quot;))
	Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-11-05T14:32:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143173#p143173</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: WinGetTitle - Запрет на получение названия всех окон Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143171#p143171" />
			<content type="html"><![CDATA[<p>Через &quot;ProcessName&quot; не получилось, записывался результат последнего найденного окна, а не активного. Решил через класс:<br /></p><div class="codebox"><pre><code>
	WinGetClass, gamewin1, A
	if (gamewin1 == &quot;AutoHotkeyGUI&quot;) 
	{
		OnHelp()
	}
	else
	{
	WinGetTitle, gamewin, A
	WB.document.getElementById(&quot;fc1&quot;).placeholder := gamewin
	}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Botsy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41069</uri>
			</author>
			<updated>2020-11-05T14:29:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143171#p143171</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: WinGetTitle - Запрет на получение названия всех окон Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143170#p143170" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Botsy пишет:</cite><blockquote><p>есть главное окно скрипта &quot;Gui :Parent&quot; с WinTitle &quot;Main&quot;, в котором можно открыть еще окна</p></blockquote></div><p>Ну так это просто другое окно, вы его не в окне Parent открываете.<br />Проверяйте что окно принадлежит процессу скрипта.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-11-05T13:55:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143170#p143170</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: WinGetTitle - Запрет на получение названия всех окон Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143169#p143169" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong> <br />Так создаю главное окно, то что видно при запуске скрипта:<br /></p><div class="codebox"><pre><code>
Gui, Parent: New, ,Main
Gui, Parent: -DPIScale 
Gui, Parent: Margin, 0, 0
Gui, Parent: Add, ActiveX, w1080 h854 vWB, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WB.document.write(html)
Gui, Parent: Show
</code></pre></div><p>... Допустим что-то делается...<br />... Вызываю функцию...</p><p>Это окно из вызванной функции:<br /></p><div class="codebox"><pre><code>
Gui, Stats: New, , Menu
Gui, Stats: Margin, 0, 0
Gui, Stats: Add, ActiveX, w500 h300 vWBStats, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WBStats.document.write(html)
Gui, Stats: Show
return

StatsGuiClose:
Gui, Destroy
return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Botsy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41069</uri>
			</author>
			<updated>2020-11-05T13:51:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143169#p143169</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: WinGetTitle - Запрет на получение названия всех окон Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143168#p143168" />
			<content type="html"><![CDATA[<p>Хотя как у вас дочернее окно становится активным? Оно же внутри родительского.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-11-05T13:40:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143168#p143168</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: WinGetTitle - Запрет на получение названия всех окон Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143167#p143167" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Botsy пишет:</cite><blockquote><p>подконтрольных главному</p></blockquote></div><p>Проверяйте активное окно на принадлежность основному окну с помощью GetParent.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-11-05T13:36:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143167#p143167</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: WinGetTitle - Запрет на получение названия всех окон Gui]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143166#p143166" />
			<content type="html"><![CDATA[<p>Добрейшего всем. Можно ли как-то более компактно (чем перечислять все окна) запретить получение всех окон Gui, через команду WinGetTitle ? Перечислить не лень, окон не много. А если бы их было много, просто вдруг есть другой способ ?</p><div class="codebox"><pre><code>
gamewin = 

^5::
	WinGetTitle, gamewin, A
	if (gamewin == &quot;Main&quot;
	|| gamewin == &quot;Menu1&quot;
	|| gamewin == &quot;Menu2&quot;
	|| gamewin == &quot;Menu3&quot;) ; перечисление всех окон подконтрольных главному &quot;Main&quot;
	{
		gamewin =
		OnHelp()
	}
	else
	WB.document.getElementById(&quot;fc1&quot;).placeholder := gamewin
return
</code></pre></div><br /><p>- Предположим, есть главное окно скрипта &quot;Gui :Parent&quot; с WinTitle &quot;Main&quot;, в котором можно открыть еще окна &quot;Gui :Menu&quot;, &quot;Gui :Menu1&quot; и т.д. со своими названиями (WinTitle = Menu1, Menu2, Menu3 ...).<br />- Клавишей &quot;ctrl + 5&quot; можно получить название окна. Если оно относится к окну скрипта, то переменная будет пустой, а если нет, то получит значение.</p>]]></content>
			<author>
				<name><![CDATA[Botsy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41069</uri>
			</author>
			<updated>2020-11-05T13:26:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143166#p143166</id>
		</entry>
</feed>
