<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK:RegRead значение по умолчанию]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=12657</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12657&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK:RegRead значение по умолчанию».]]></description>
		<lastBuildDate>Sat, 06 May 2017 16:31:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115690#p115690</link>
			<description><![CDATA[<p>Спасибо большое <strong>Alectric</strong> за разъяснения , всё работает.</p>]]></description>
			<author><![CDATA[null@example.com (Ядрён)]]></author>
			<pubDate>Sat, 06 May 2017 16:31:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115690#p115690</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115682#p115682</link>
			<description><![CDATA[<p>Соблюдай последовательность действий, а не просто раскидывай куски кода в редакторе.</p><div class="codebox"><pre><code>#NoEnv
#Persistent
#Singleinstance, force
SetWorkingDir, %A_ScriptDir%/res
SetBatchLines,-1
CoordMode,Mouse,Screen
CoordMode,tooltip,Screen
CoordMode,Caret,Screen
SetKeyDelay, -1, -1
SetWinDelay,20
OnExit, Exit

;======================== Меню ===================================
RegRead, xxxx, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, xdirectory
RegRead, yyyy, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, ydirectory




if (xxxx=&quot;&quot;)
{
  xxxx=555
  RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, xdirectory, %xxxx%
}
if (yyyy=&quot;&quot;)
{
  yyyy=111
  RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, ydirectory, %yyyy%
}

Gui, +AlwaysOnTop -Caption +ToolWindow +LastFound
Gui, Add, Picture, x0 y0 w20 h16  vStatic1, Ru1.png
 Gui, Add, Picture, x0 y0 w20 h16 vStatic2, En1.png
Gui, Show, x%xxxx% y%yyyy% h16 w20 NA, lang053




hGui:=WinExist()
...

...

...</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alectric)]]></author>
			<pubDate>Sat, 06 May 2017 07:00:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115682#p115682</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115678#p115678</link>
			<description><![CDATA[<p><span class="postimg"><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQtAKH3aQQ3eVD8SFIO7EYfo2H84lhsBmIV7UoHAF8rEywui0mH" alt="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQtAKH3aQQ3eVD8SFIO7EYfo2H84lhsBmIV7UoHAF8rEywui0mH" /></span></p>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Fri, 05 May 2017 18:39:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115678#p115678</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115677#p115677</link>
			<description><![CDATA[<p>Уважаемый <strong>Alectric</strong> , в моём скрипте не работает. Значение по умолчанию ставятся , при выходе записываются новые (чего и добивался) , но при старте скрипта меняются на значения по умолчанию. А нужно что бы первый раз когда запускаешь скрипт он стартовал со значениями по умолчанию , а все остальные значения брал с последнего местоположения окна.&nbsp; <br /></p><div class="codebox"><pre><code>#NoEnv
#Persistent
#Singleinstance, force
SetWorkingDir, %A_ScriptDir%/res
SetBatchLines,-1
CoordMode,Mouse,Screen
CoordMode,tooltip,Screen
CoordMode,Caret,Screen
SetKeyDelay, -1, -1
SetWinDelay,20
OnExit, Exit
if (xxxx=&quot;&quot;)
{
  xxxx=555
  RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, xdirectory, %xxxx%
}
if (yyyy=&quot;&quot;)
{
  yyyy=111
  RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, ydirectory, %yyyy%
}


Gui, +AlwaysOnTop -Caption +ToolWindow +LastFound 
Gui, Add, Picture, x0 y0 w20 h16  vStatic1, Ru1.png  
 Gui, Add, Picture, x0 y0 w20 h16 vStatic2, En1.png   
Gui, Show, x%xxxx% y%yyyy% h16 w20 NA, lang053
;======================== Меню ===================================
RegRead, xxxx, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, xdirectory
RegRead, yyyy, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, ydirectory





hGui:=WinExist()

loop
{
   MouseGetPos,,,mwin
   oldlang:=lang
   lang:=InputLayout()
   if (oldlang!=lang)
   If (lang = &quot;Russian&quot;)
   {
    Menu, Tray, Icon, Ru.ico, 1, 1
GuiControl, hide, static2
    GuiControl, Show, static1 

   }
   Else If (lang = &quot;English&quot;)
   {
    Menu, Tray, Icon, En.ico, 1, 1
GuiControl, hide, static1
      GuiControl, Show, static2

   }
   Gui, +AlwaysOnTop -Caption +ToolWindow +LastFound
   sleep, 50
}


#if (mwin=hGui)
lbutton::

MoveWin(hGui)

return
#if

MoveWin(hwnd,key=&quot;lbutton&quot;)
{
  MouseGetPos,oldmmx,oldmmy
  while GetKeyState(key,&quot;P&quot;)
  {
    sleep,10
    MouseGetPos,mmx,mmy
    WinGetPos,wx,wy,ww,wh,ahk_id %hwnd%
    wx:=wx+mmx-oldmmx
    wy:=wy+mmy-oldmmy
    WinMove,ahk_id %hwnd%,,%wx%,%wy%
   
    oldmmx:=mmx
    oldmmy:=mmy

  }

   
  return
}

InputLayout()
{
    WinGetClass, Class, % &quot;ahk_id&quot; hID := WinExist(&quot;A&quot;)
    if !id := DllCall(&quot;GetWindow&quot;, Ptr, hid, UInt, GW_OWNER := 4, Ptr)
      id:=hID
    ThreadID := DllCall(&quot;GetWindowThreadProcessId&quot;, &quot;Int&quot;, id, &quot;Int&quot;, 0)
    HKL := DllCall(&quot;GetKeyboardLayout&quot;, &quot;uint&quot;, ThreadID, &quot;UShort&quot;)
    VarSetCapacity(sKbd, 260, 0)
    DllCall(&quot;GetLocaleInfo&quot;, &quot;uint&quot;, HKL
                           , &quot;uint&quot;, 0x1001
                           , &quot;str&quot;,  sKbd
                           , &quot;uint&quot;, 260)
    Return sKbd
}

Exit:
IfWinExist, lang053
{
    WinGetPos, xxxx, yyyy 
   
}
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, xdirectory, %xxxx%
     sleep, 60
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, ydirectory, %yyyy%
         sleep, 60 
  Exitapp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Ядрён)]]></author>
			<pubDate>Fri, 05 May 2017 16:49:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115677#p115677</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115675#p115675</link>
			<description><![CDATA[<div class="codebox"><pre><code>OnExit, Exit

RegRead, xxxx, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, xdirectory
RegRead, yyyy, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, ydirectory

if (xxxx=&quot;&quot;)
{
  xxxx=555
  RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, xdirectory, %xxxx%
}
if (yyyy=&quot;&quot;)
{
  yyyy=111
  RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, ydirectory, %yyyy%
}
</code></pre></div><p><a href="http://forum.script-coding.com/viewtopic.php?id=10783">http://forum.script-coding.com/viewtopic.php?id=10783</a></p>]]></description>
			<author><![CDATA[null@example.com (Alectric)]]></author>
			<pubDate>Fri, 05 May 2017 12:18:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115675#p115675</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115674#p115674</link>
			<description><![CDATA[<p>Вы неправильно поняли термин &quot;по умолчанию&quot;.<br />В случае с реестром это особое значение, которое принадлежит самому разделу реестра.<br />По аналогии с ФС информацию можно было бы записывать не только в файлы, но и в папки.<br /></p><div class="codebox"><pre><code>x:=42 ; запись и чтение параметра по умолчанию раздела HKEY_LOCAL_MACHINE\SOFTWARE\Scriptss
RegWrite REG_SZ, HKEY_LOCAL_MACHINE\SOFTWARE\Scriptss,, %x%
RegRead xOut, HKEY_LOCAL_MACHINE\SOFTWARE\Scriptss
MsgBox % xOut</code></pre></div><p>Установку дефолтных значений, если в реестре ничего не найдено, кодируйте самостоятельно.</p>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Fri, 05 May 2017 05:20:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115674#p115674</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115670#p115670</link>
			<description><![CDATA[<p>Так тоже&nbsp; не выходит.<br /></p><div class="codebox"><pre><code>RegRead, xxxx, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, %xdirectory%
If xdirectory = 
 ErrorLevel = 0
    Return

RegRead, yyyy, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, %ydirectory%
 If ydirectory = 
ErrorLevel = 0
Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Ядрён)]]></author>
			<pubDate>Thu, 04 May 2017 21:52:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115670#p115670</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115669#p115669</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>ValueName	—	Имя параметра, чьё значение нужно прочитать. Если опущен или пустой, будет считан параметр, который в редакторе реестра отображается под именем &quot;(По умолчанию)&quot;. Если ему не присвоено никакого значения, выходная переменная будет пустой и ErrorLevel равен 1.</p></blockquote></div><p><span class="postimg"><img src="https://s8.hostingkartinok.com/uploads/images/2017/05/540b7cee13aee1c936e5f0fa67b56680.png" alt="https://s8.hostingkartinok.com/uploads/images/2017/05/540b7cee13aee1c936e5f0fa67b56680.png" /></span></p>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Thu, 04 May 2017 21:29:30 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115669#p115669</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115668#p115668</link>
			<description><![CDATA[<p>Ну последний параметр в &quot;RegRead&quot; отвечает за значение по умолчанию, это в моём скрипте &quot;xdirectory&quot; и&nbsp; &quot;ydirectory&quot; . Получается так , но так не работает.<br /></p><div class="codebox"><pre><code>xdirectory := 600
ydirectory := 600</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Ядрён)]]></author>
			<pubDate>Thu, 04 May 2017 21:17:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115668#p115668</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115662#p115662</link>
			<description><![CDATA[<p>Прочитать справку по &quot;RegRead&quot;. Что непонятно - спросить.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Thu, 04 May 2017 18:53:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115662#p115662</guid>
		</item>
		<item>
			<title><![CDATA[AHK:RegRead значение по умолчанию]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=115661#p115661</link>
			<description><![CDATA[<p>Доброго времени суток. Подскажите пожалуйста как выставить значение по умолчанию в &quot;RegRead&quot;. Записать и прочитать параметры я смог а вот выставить по умолчанию никак. Только <br />если вручную значения в реестре прописать то работает.<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p>Справку по&quot;RegRead&quot; не предлагать я там ничего не понял.</p></div></div><div class="quotebox"><blockquote><p>Пример.</p></blockquote></div><div class="codebox"><pre><code>OnExit, Exit

RegRead, xxxx, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, xdirectory
RegRead, yyyy, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, ydirectory


Gui, Add, Edit, r9
Gui, Show, x%xxxx% y%yyyy% , lang053
   return

GuiClose:
Exit:
IfWinExist, lang053
{
    WinGetPos, xxxx, yyyy 
   
}
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, xdirectory, %xxxx%
     sleep, 60
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SOFTWARE\Scriptss, ydirectory, %yyyy%
         sleep, 60 
  Exitapp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Ядрён)]]></author>
			<pubDate>Thu, 04 May 2017 17:16:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=115661#p115661</guid>
		</item>
	</channel>
</rss>
