<?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=6597&amp;type=atom" />
	<updated>2011-12-26T14:03:05Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=6597</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки по-умолчанию]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=54978#p54978" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>InFlames пишет:</cite><blockquote><p>Вот такой вариант получился. Добавлю после одобрения. Вроде всё нормально работает.<br />Только вопрос по первой строке: для чего в конце стоит следующее?<br /></p><div class="codebox"><pre><code> . &quot; &quot; . rlangid</code></pre></div></blockquote></div><p>Это не нужно, я проверял в каком порядке происходит вызов функции и возможно ли вывести её результат(находящийся в переменной) в одной строке с её вызовом <img src="//forum.script-coding.com/img/smilies/cool.png" width="15" height="15" /><br />Ещё наверное необходимо подметить что <strong>Language Identifier</strong> возвращаемый функцией состоит из двух значений, <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd318691(v=vs.85).aspx">см. подробней здесь</a></p>]]></content>
			<author>
				<name><![CDATA[kirtech]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26525</uri>
			</author>
			<updated>2011-12-26T14:03:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=54978#p54978</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки по-умолчанию]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=54969#p54969" />
			<content type="html"><![CDATA[<p>Вот такой вариант получился. Добавлю после одобрения. Вроде всё нормально работает.<br />Только вопрос по первой строке: для чего в конце стоит следующее?<br /></p><div class="codebox"><pre><code> . &quot; &quot; . rlangid</code></pre></div><div class="codebox"><pre><code>DllCall(&quot;SystemParametersInfo&quot;, &quot;Uint&quot;, SPI_GETDEFAULTINPUTLANG:=0x0059 , &quot;Uint&quot;,0, &quot;Uint*&quot;,rlangid, &quot;Uint&quot;, 0) . &quot; &quot; . rlangid
SetFormat, IntegerFast, hex
rlangid:=rlangid&gt;&gt;16
rlangid.=&quot;&quot;
if  (rlangid!=&quot;0x409&quot;)
{
   MsgBox,4,, Раскладка по-умолчанию не английскиая. Сменить?
   IfMsgBox, yes
   {
      DllCall(&quot;SystemParametersInfo&quot;, &quot;Uint&quot;, SPI_SETDEFAULTINPUTLANG:=0x005A , &quot;Uint&quot;,0, &quot;Uint*&quot;,langid:=0x409, &quot;Uint&quot;, SPIF_SENDCHANGE:=2)
      Reload
      return
   }
   else
      ExitApp
}
SetFormat, IntegerFast, d

hotkey, #z, Label, on
return
Label:
MsgBox
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[InFlames]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24849</uri>
			</author>
			<updated>2011-12-26T06:14:55Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=54969#p54969</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки по-умолчанию]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=54968#p54968" />
			<content type="html"><![CDATA[<p>Финальную версию — всенепременно необходимо добавить в коллекцию.<br />Скрипт будет актуален пока в ahk присутствуют буквенные метки хоткеев.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2011-12-26T04:58:45Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=54968#p54968</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки по-умолчанию]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=54965#p54965" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>MsgBox % DllCall(&quot;SystemParametersInfo&quot;, &quot;Uint&quot;, SPI_SETDEFAULTINPUTLANG:=0x005A , &quot;Uint&quot;,0, &quot;Uint*&quot;,langid:=0x409, &quot;Uint&quot;, SPIF_SENDCHANGE:=2)
DllCall(&quot;SystemParametersInfo&quot;, &quot;Uint&quot;, SPI_GETDEFAULTINPUTLANG:=0x0059 , &quot;Uint&quot;,0, &quot;Uint*&quot;,rlangid, &quot;Uint&quot;, 0) . &quot; &quot; . rlangid
SetFormat, IntegerFast, hex
rlangid:=rlangid&gt;&gt;16
rlangid.=&quot;&quot;
SetFormat, IntegerFast, d
MsgBox % rlangid</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kirtech]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26525</uri>
			</author>
			<updated>2011-12-25T23:35:23Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=54965#p54965</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки по-умолчанию]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=54959#p54959" />
			<content type="html"><![CDATA[<p>Функция возвращает ноль.<br />Где копать?</p><div class="codebox"><pre><code>RegRead, Locale, HKCU, Keyboard Layout\Preload, 1
If locale != 409
{
    msgbox,20,, Раскладка клавиатуры по-умолчанию должна стоять Английская.`n`nСменить?`nДа = сменить`nНет = выйти
    IfMsgBox, Yes
    {
        RegRead, Locale2, HKCU, Keyboard Layout\Preload, 2
        RegWrite,REG_SZ, HKCU, Keyboard Layout\Preload, 1, % locale2
        RegWrite,REG_SZ, HKCU, Keyboard Layout\Preload, 2, % locale
        MsgBox % DllCall(&quot;SystemParametersInfo&quot;, &quot;Uint&quot;, SPI_SETDEFAULTINPUTLANG:=0x005A , &quot;Uint&quot;, 00000409, &quot;Uint&quot;, 0, &quot;Uint&quot;, SPIF_SENDCHANGE:=2)
        Reload
    }
    else
        ExitApp
}

hotkey, #Z, SendZ, On
return

SendZ:
MsgBox Всё ОК
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[InFlames]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24849</uri>
			</author>
			<updated>2011-12-25T14:28:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=54959#p54959</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Смена раскладки по-умолчанию]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=54958#p54958" />
			<content type="html"><![CDATA[<p>Думаю, нужно ещё информировать систему об изменении с помощью <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx">SystemParametersInfo()</a>. Нужный параметр — SPI_SETDEFAULTINPUTLANG.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-12-25T13:39:42Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=54958#p54958</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Смена раскладки по-умолчанию]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=54956#p54956" />
			<content type="html"><![CDATA[<p>Написал следующий код.<br />1 Ставлю язык ввода по-умолчанию русский через панель управления.<br />2 Запускаю скрипт, нажимаю ДА<br />3 В реестре значения меняются на нужные (англ. раскладка становится по-умолчанию)<br />4 В панели управления тоже стоит английская по-умолчанию при этом<br />Скрипт всё равно ругается на отсутствие хоткея Z в системе<br />Захожу в панель управления, еще раз проверяю, что стоит именно английский по-умолчанию. <strong>И только после того как нажму ОК</strong> в панели управления (языки и регион. стандарты), скрипт запускается нормально.<br />Т.е. программно смены данных в реестре в ветке HKCU, Keyboard Layout\Preload не достаточно. Еще должно быть какое-то условие, чтобы раскладка клавиатуры полностью стала по-умолчаню.<br />Надеюсь не заморочил. Как полностью в ahk сменить раскладку клавиатуры по-умолчанию?</p><div class="codebox"><pre><code>RegRead, Locale, HKCU, Keyboard Layout\Preload, 1
If locale != 409
{
    msgbox,20,, Раскладка клавиатуры по-умолчанию должна стоять Английская.`n`nСменить?`nДа = сменить`nНет = выйти
    IfMsgBox, Yes
    {
        RegRead, Locale2, HKCU, Keyboard Layout\Preload, 2
        RegWrite,REG_SZ, HKCU, Keyboard Layout\Preload, 1, % locale2
        RegWrite,REG_SZ, HKCU, Keyboard Layout\Preload, 2, % locale
        Reload
    }
    else
        ExitApp
}

hotkey, #Z, SendZ, On
return

SendZ:
MsgBox Всё ОК
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[InFlames]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24849</uri>
			</author>
			<updated>2011-12-25T13:04:12Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=54956#p54956</id>
		</entry>
</feed>
