<?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=6724&amp;type=atom" />
	<updated>2016-05-15T20:27:31Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6724</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103818#p103818" />
			<content type="html"><![CDATA[<p>Здравствуйте. Помогите пожалуйста.<br /></p><div class="codebox"><pre><code>
; блок переменных
...
; конец блока
Gui, ; настройки и прочие элементы первого окна

Gui, 2: ; настройки и прочие элементы второго окна

; подпрограмма с телом сценария
sub_main:
...
return
</code></pre></div><p>В первом окне управляющие элементы, задающие настройки и общий характер поведения сценария, а во втором своего рода лог, в котором отображается содержимое нужных переменных из &quot;sub_main&quot;. Вероятно, это должна быть отформатированная символом &quot;`n&quot; строка, предварительно собранная из нужных данных, но что-то как не пытался применить материал выше - не получается. Гугль тоже не помог. Подскажите пожалуйста реализацию.</p><p>Несколько позже:</p><p>Разобрался через:<br /></p><div class="codebox"><pre><code>
ControlSetText, Static1, % OutputVar2, % &quot;ahk_id&quot;hGUI2
</code></pre></div><p>Если я правильно понял, &quot;Static1&quot; - это первый контейнер GUI указанного в его хендле последним параметром. Если не затруднит, поделитесь пожалуйста ссылкой, где об этом подробно написано.</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-05-15T20:27:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103818#p103818</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55986#p55986" />
			<content type="html"><![CDATA[<p>Впрочем, — пропустим это, не важно...</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2012-01-24T22:24:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55986#p55986</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55985#p55985" />
			<content type="html"><![CDATA[<p>Нет, <strong>ypppu</strong>,&nbsp; — если попытаетесь вникнуть в суть моей просьбы, увидите, что с самого начала веду речь об одном и том же.<br />Я не наглею (хочется в это верить <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />).</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2012-01-24T22:10:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55985#p55985</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55984#p55984" />
			<content type="html"><![CDATA[<p>А теперь построй-ка мне избу! (c) <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2012-01-24T21:33:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55984#p55984</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55981#p55981" />
			<content type="html"><![CDATA[<p><img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Если утомил не сильно, <strong>Grey</strong>, — возможно будет устранить возникающую ошибку из первого поста, сохранив последовательность таймеров-обращений и без необходимости создания нового подтаймера (в идеале — оставив стартовый таймер и переменную в строке<br /></p><div class="codebox"><pre><code>Gui, Add, Text,w74 Center vNow gNowEvent, %A_Now%</code></pre></div><p>без изменений)?<br />Дело в том, что специфика предстоящего использования фрагмента не допустит других комбинаций (двух таймеров и тд).</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2012-01-24T19:49:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55981#p55981</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55978#p55978" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>...
Timer:
   GuiControl,, Now, % A_Hour &quot;:&quot;A_Min &quot;.&quot;A_Sec &quot;`n&quot;OutputVar

;обращение/получение
;   GuiControlGet, OutputVar2,, Now
;   GuiControlGet, OutputVar2,, Static1
;   ControlGetText, OutputVar2, % Now, % &quot;ahk_id&quot;hGUI
   ControlGetText, OutputVar2, Static1, % &quot;ahk_id&quot;hGUI

;вывод
;   GuiControl, 2:, Now2, % OutputVar2
;   GuiControl, 2:, Static1, % OutputVar2
;   ControlSetText, % Now2, % OutputVar2, % &quot;ahk_id&quot;hGUI2
   ControlSetText, Static1, % OutputVar2, % &quot;ahk_id&quot;hGUI2
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-01-24T14:13:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55978#p55978</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55967#p55967" />
			<content type="html"><![CDATA[<p><strong>Grey</strong>, а осуществима ли такая последовательность: сначала обращение к подпрограмме по таймеру, — затем получение-вывод текста (без создания дополнительного подтаймера)?<br />И спасибо за долготерпение <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2012-01-24T07:36:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55967#p55967</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55963#p55963" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>DetectHiddenWindows, On
FormatTime, OutputVar,, ShortDate
SysGet, Workspace, MonitorWorkArea
Gui, +AlwaysOnTop -Caption +ToolWindow HwndhGUI
Gui, Color, 00833F
Gui, Font, s7 Bold cFFFF00
Gui, Add, Text, vNow w75 h26 Center
Gui, Show, Hide
Gui, 2: +AlwaysOnTop +ToolWindow -SysMenu HwndhGUI2
;Gui, 2: Add, Text, vNow2 w75 h26 Center
Gui, 2: Add, Text, w75 h26 Center
Gui, 2: Show, AutoSize, Same Title
WinGetPos, GUIX, GUIY, GUIWidth, GUIHeight, % &quot;ahk_id&quot;hGUI
NewX:=WorkSpaceRight-GUIWidth-26
NewY:=WorkspaceBottom-GUIHeight-0
Gui, Show, % &quot;Hide x&quot;NewX &quot; y&quot;NewY
SetTimer, Timer, 1000
DllCall(&quot;AnimateWindow&quot;, &quot;UInt&quot;, hGUI
                       , &quot;Int&quot;, 950
                       , &quot;UInt&quot;, 0x80000)
Return
 
Timer:
   GuiControl,, Now, % A_Hour &quot;:&quot;A_Min &quot;.&quot;A_Sec &quot;`n&quot;OutputVar

;   GuiControlGet, OutputVar2,, Now
;   GuiControlGet, OutputVar2,, Static1
;   ControlGetText, OutputVar2, % Now, % &quot;ahk_id&quot;hGUI
   ControlGetText, OutputVar2, Static1, % &quot;ahk_id&quot;hGUI

;   GuiControl, 2:, Now2, % OutputVar2
;   GuiControl, 2:, Static1, % OutputVar2
;   ControlSetText, % Now2, % OutputVar2, % &quot;ahk_id&quot;hGUI2
   ControlSetText, Static1, % OutputVar2, % &quot;ahk_id&quot;hGUI2
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-01-24T06:40:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55963#p55963</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55957#p55957" />
			<content type="html"><![CDATA[<p>Нужно циклично получать в переменную меняющийся заголовок определённого конкретного окна (у меня для примера — &quot;%A_Now%&quot;), и выводить содержимое полученной переменной в GUI.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2012-01-24T03:39:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55957#p55957</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55955#p55955" />
			<content type="html"><![CDATA[<p>Извини, мне не понятно, что за &quot;заголовок&quot;, какой &quot;проверкой&quot;?...</p>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-01-24T03:20:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55955#p55955</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55952#p55952" />
			<content type="html"><![CDATA[<p><strong>Grey</strong>, кажется, не совсем подходит — вместо переменной текущего времени, на практике предполагалось считывать меняющийся заголовок (проверкой по таймеру), с последующим выводом значения в GUI-окно.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2012-01-24T02:35:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55952#p55952</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55948#p55948" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>DetectHiddenWindows, On
FormatTime, OutputVar,, ShortDate
SysGet, Workspace, MonitorWorkArea
Gui, +AlwaysOnTop -Caption +ToolWindow HwndhGUI
Gui, Color, 00833F
Gui, Font, s7 Bold cFFFF00
Gui, Add, Text, vNow w75 h26 Center
Gui, Show, Hide
WinGetPos, GUIX, GUIY, GUIWidth, GUIHeight, % &quot;ahk_id&quot;hGUI
NewX:=WorkSpaceRight-GUIWidth-26
NewY:=WorkspaceBottom-GUIHeight-0
Gui, Show, % &quot;Hide x&quot;NewX &quot; y&quot;NewY
SetTimer, Timer, 1000
Return

Timer:
   GuiControl,, Now, % A_Hour &quot;:&quot;A_Min &quot;.&quot;A_Sec &quot;`n&quot;OutputVar
   DllCall(&quot;AnimateWindow&quot;, &quot;UInt&quot;, hGUI
                          , &quot;Int&quot;, 250
                          , &quot;UInt&quot;, 0x80000)
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-01-24T00:29:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55948#p55948</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Обновляющийся текст в окне GUI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55947#p55947" />
			<content type="html"><![CDATA[<p>Подскажите, как наладить меняющийся по таймеру текст?</p><div class="codebox"><pre><code>#SingleInstance Force
DetectHiddenWindows, on

  SetTimer, Timer, 3000
  Return

Timer:
  SysGet, Workspace, MonitorWorkArea 
  Gui, default 
  Gui, -Caption +ToolWindow +LastFound +AlwaysOnTop
  Gui, Color, 00833F
  Gui, Font, s7 bold cFFFFFF
  Gui, Add, Text,w74 Center vNow gNowEvent, %A_Now%

  Gui, Show, Hide 
  GUI_ID := WinExist() 
  WinGetPos, GUIX, GUIY, GUIWidth, GUIHeight, ahk_id %GUI_ID% 
  NewX := WorkSpaceRight-GUIWidth-26
  NewY := WorkspaceBottom-GUIHeight-0 
  Gui, Show, Hide x%NewX% y%NewY%

  DllCall(&quot;AnimateWindow&quot;,&quot;UInt&quot;,GUI_ID,&quot;Int&quot;,500,&quot;UInt&quot;,&quot;0x00040008&quot;)
  Return

NowEvent:
  ;GuiControl, , Now, % A_Now
  ;DllCall(&quot;AnimateWindow&quot;,&quot;UInt&quot;,GUI_ID,&quot;Int&quot;,1000,&quot;UInt&quot;,&quot;0x90000&quot;) ; Fade out
  Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2012-01-23T21:47:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55947#p55947</id>
		</entry>
</feed>
