<?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=11548&amp;type=atom" />
	<updated>2016-05-03T11:15:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11548</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103291#p103291" />
			<content type="html"><![CDATA[<p>О как, дискуссия продолжилась. Спасибо, почерпнул для себя массу нового :-)</p>]]></content>
			<author>
				<name><![CDATA[vospa]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30538</uri>
			</author>
			<updated>2016-05-03T11:15:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103291#p103291</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103268#p103268" />
			<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-05-02T11:07:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103268#p103268</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103262#p103262" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Хотя и не обязательно. Вот так без включения <em>DetectHiddenWindows, On</em>:<br /></p><div class="codebox"><pre><code>Gui, +LastFound
Gui, Add, Text
PostMessage, WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_FORWARD := 0x2,, Static1
Gui, Show, NA w300 h300
Return</code></pre></div></blockquote></div><p>Можно и так:</p><div class="codebox"><pre><code>Gui, Add, Text, hwndhText
PostMessage, WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_FORWARD := 0x2,,, ahk_id %hText%
Gui, Show, NA w300 h300
Return</code></pre></div><p>Если без DetectHiddenWindows, то в общем случае так:</p><div class="codebox"><pre><code>DllCall(&quot;PostMessage&quot;, &quot;Ptr&quot;, A_ScriptHWND, &quot;UInt&quot;, WM_INPUTLANGCHANGEREQUEST := 0x50, &quot;UInt&quot;, INPUTLANGCHANGE_FORWARD := 0x2, &quot;UInt&quot;, 0x00)
Gui, Show, NA w300 h300
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-05-02T08:50:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103262#p103262</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103261#p103261" />
			<content type="html"><![CDATA[<p>Ну в AHK же вроде всего один реальный поток, так что здесь это без разницы.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-05-02T05:55:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103261#p103261</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103260#p103260" />
			<content type="html"><![CDATA[<p>Язык ввода — это свойство не окна, а потока. Поэтому он и меняется для всех окон, созданных потоком (а не всем процессом).</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2016-05-02T05:20:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103260#p103260</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103259#p103259" />
			<content type="html"><![CDATA[<p>Хотя и не обязательно. Вот так без включения <em>DetectHiddenWindows, On</em>:<br /></p><div class="codebox"><pre><code>Gui, +LastFound
Gui, Add, Text
PostMessage, WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_FORWARD := 0x2,, Static1
Gui, Show, NA w300 h300
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-05-02T00:34:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103259#p103259</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103258#p103258" />
			<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-05-02T00:23:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103258#p103258</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103257#p103257" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Если нужно сменить раскладку неактивного окна, можно обращаться к нему по-другому, через хэндл или заголовок.</p></blockquote></div><p>Это понятно, но контрола в фокусе нет до его активации.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-05-02T00:08:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103257#p103257</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103256#p103256" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Бывает всяко, может контрол потом добавляется, опять же окно при показе может не активизироватся, ждать активации?</p></blockquote></div><p>Ну, по-моему, здесь надуманная проблема. Какой смысл менять раскладку, если нет элемента ввода? Если нужно сменить раскладку неактивного окна, можно обращаться к нему по-другому, через хэндл или заголовок.</p><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>при нажатии соответственных смене языка клавиш, он меняется</p></blockquote></div><p>Например, вот так при нажатии системных клавиш для смены раскладки, раскладка меняется у обоих окон:</p><div class="codebox"><pre><code>Gui, Show, x300 w111 h111
Gui, 2:Show, x500 w111 h111</code></pre></div><p>Видимо, система как раз посылает главному окну.<br />Хотя, вот так тоже меняется у обоих, как я заметил:<br /></p><div class="codebox"><pre><code>Gui, Show, x300 w111 h111
Gui, 2:Add, Text
Gui, 2:Show, x500 w111 h111
ControlGetFocus, CtrlFocus, A
PostMessage, WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_FORWARD := 0x2,, %CtrlFocus%, A
Return</code></pre></div><p>Так что моё «в общем случае» скорее имеет смысл для окна вообще, а не именно для окна AHK.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-05-02T00:00:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103256#p103256</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103255#p103255" />
			<content type="html"><![CDATA[<p>Бывает всяко, может контрол потом добавляется, опять же окно при показе может не активизироватся, ждать активации?</p><div class="codebox"><pre><code>Gui, Add, Text
Gui, Show, NA w111 h111
ControlGetFocus, CtrlFocus, A
PostMessage, WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_FORWARD := 0x2,, %CtrlFocus%, A
Return
</code></pre></div><p>Просто если даже контролов нет, при нажатии соответственных смене языка клавиш, он меняется, потому интересно как оно может <span class="bbu">ещё</span> &quot;делатся&quot;.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-05-01T23:46:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103255#p103255</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103254#p103254" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Ммм, если контрола нет, язык не меняет</p></blockquote></div><p>Да, действительно, так не меняет. Но окон без контролов обычно не бывает. Вот так уже работает:<br /></p><div class="codebox"><pre><code>Gui, Add, Text
Gui, Show, w111 h111
ControlGetFocus, CtrlFocus, A
PostMessage, WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_FORWARD := 0x2,, %CtrlFocus%, A
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-05-01T23:38:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103254#p103254</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103253#p103253" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>У процесса скрипта есть главное скрытое окно, поэтому, если послать сообщение ему, сменится раскладка у всех окон. У вас не заработало, потому что в фокусе Edit, а сообщение посылается окну вообще.</p></blockquote></div><p>Ааа... вон оно что... <br />Обычно стараюсь сам понять и разобраться. Но вот с этим уже пару дней периодически открывал, пробовал, и ничего не получалось. Потому и решил спросить на форуме :-) Большое спасибо!</p>]]></content>
			<author>
				<name><![CDATA[vospa]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30538</uri>
			</author>
			<updated>2016-05-01T23:36:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103253#p103253</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103252#p103252" />
			<content type="html"><![CDATA[<p>Ммм, если контрола нет, язык не меняет, или ты про что &quot;не увидел&quot;.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-05-01T23:31:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103252#p103252</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103251#p103251" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>vospa пишет:</cite><blockquote><p>Для начала, мне теперь нужно переварить ответ и понять, почему так заработало.</p></blockquote></div><p>У процесса скрипта есть главное скрытое окно, поэтому, если послать сообщение ему, сменится раскладка у всех окон. У вас не заработало, потому что в фокусе Edit, а сообщение посылается окну вообще.<br /></p><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Я про то что, мало ли:</p></blockquote></div><p>Ну вот, опять не увидел! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-05-01T23:28:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103251#p103251</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки клавиатуры в активном окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103250#p103250" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>посылать надо в контрол в фокусе</p></blockquote></div><p>Я про то что, мало ли:<br /></p><div class="codebox"><pre><code>
Gui, Show, w111 h111 
ControlGetFocus, CtrlFocus, A
PostMessage, WM_INPUTLANGCHANGEREQUEST := 0x50, INPUTLANGCHANGE_FORWARD := 0x2,, %CtrlFocus%, A
Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-05-01T23:28:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103250#p103250</id>
		</entry>
</feed>
