<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10416</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10416&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Продолжение работы скрипта после нажатия кнопки в GUI».]]></description>
		<lastBuildDate>Sun, 22 Feb 2015 02:03:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91773#p91773</link>
			<description><![CDATA[<p><a href="http://fincs.ahk4.net/scite4ahk/">http://fincs.ahk4.net/scite4ahk/</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sun, 22 Feb 2015 02:03:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91773#p91773</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91703#p91703</link>
			<description><![CDATA[<p>В справке написано про потоки.</p><p>Про синтаксис - есть коллекция ссылок, там для разных редакторов можно найти синтаксис, вроде даже авторасстановка пробелов есть.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Thu, 19 Feb 2015 19:07:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91703#p91703</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91701#p91701</link>
			<description><![CDATA[<p>Alectric, спасибо. То есть, в первоначальном варианте мой цикл прерывался сразу после первого же return, а блок buttonХорошо!: срабатывал только потому, что он всегда срабатывает, если вызвана метка, даже если выполнение до него не доходит.<br />В лом пробелы с табами делать, как-то не привык я к такому. На C# в инт. среде такая штука стоит автоматически, а тут-то всё в Блокноте, приходится самому эти отступы ставить, да ещё следить, чтобы их было сколько надо соответственно уровню вложения. Дикая морока.<br />Вот когда сделают для Autohotkey свою среду с подсветкой синтаксиса и авто-отступами, это будет здорово. Да ещё бы с собственной системой отладки, чтоб выделяла строку, которая выполняется в данный момент, вообще красота была бы.<br />А так вроде всё, с gui, +hwndguihwnd я разобрался. Это запоминание ID окна в переменную. Описание GUI разделять можно (судя по тому, что вызывается окно по одному и тому же ID - значит это то же окно).<br />Ошибок скрипт не выдаёт, ОЗУ не увеличивается, reload-ов нет. Всем спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (Indrik)]]></author>
			<pubDate>Thu, 19 Feb 2015 19:00:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91701#p91701</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91700#p91700</link>
			<description><![CDATA[<p>Все что внутри цикла - будет выполняться, если не встретятся: Return, Continue или Break.<br />А строка с двоеточием это всего лишь метка перехода, цикл ее просто не замечает и идет дальше, если эта метка не была вызвана, если она была вызвана, то начнут работать команды следующие после нее до Return, после чего выполнение вернется в точку вызова этой метки, и продолжится дальше, также не замечая метки.</p><p><span style="color: #eeeeee">OFF: Ужас какое сложное предложение составил... и скорей всего не правильно.</span><br />Чтобы лучше понимать свой собственный код, форматируй его пробелами или табуляциями:<br /></p><div class="codebox"><pre><code>setworkingdir, %path%

gui, +hwndguihwnd
gui, font, s14 c%col%, %font%
gui, add, text, w380 center vtextspace
gui, add, button, x155 default, Хорошо!

loop
{
  sleep, 2000
  ifexist, %name%
  {
    fileread, file, %name%
    if file
    {
      GuiControl,,textspace,%file%
      gui, show, w400 center, Сообщение от %sender%
      winwaitclose, ahk_id %guihwnd%
    }
  }
}

buttonХорошо!:
guiclose:
gui, hide
filedelete, %name%
return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alectric)]]></author>
			<pubDate>Thu, 19 Feb 2015 18:36:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91700#p91700</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91699#p91699</link>
			<description><![CDATA[<p>Одно осталось непонятно. Самый главный вопрос. Почему в моём изначальном варианта на блоке buttonХорошо!: (внутри цикла) происходило зацикливание и цикл loop не продолжался, а в новом варианте (вне цикла) этого не происходит? Есть какое-то ограничение на использование обработки нажатий внутри циклов?</p>]]></description>
			<author><![CDATA[null@example.com (Indrik)]]></author>
			<pubDate>Thu, 19 Feb 2015 18:17:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91699#p91699</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91698#p91698</link>
			<description><![CDATA[<p>Сделал вот такой вариант. Похоже, переменная file не обновляется в уже созданном gui, поэтому я перенёс часть его внутрь цикла. Так можно делать? Т.е. разбивать описание gui на две части (одна до цикла, а другая в цикле)?</p><div class="codebox"><pre><code>setworkingdir, %path%

gui, +hwndguihwnd
gui, font, s14 c%col%, %font%

loop
{
sleep, 2000
ifexist, %name%
{
fileread, file, %name%
if file
{
gui, add, text, w380 center, %file%
gui, add, button, x155 default, Хорошо!
gui, show, w400 center, Сообщение от %sender%
winwaitclose, ahk_id %guihwnd%
}
}
}

buttonХорошо!:
guiclose:
gui, hide
filedelete, %name%
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Indrik)]]></author>
			<pubDate>Thu, 19 Feb 2015 18:14:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91698#p91698</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91696#p91696</link>
			<description><![CDATA[<p>YMP, ваш вариант работает, но само сообщение (содержимое файла message.txt) не отображается. Что-то с переменной file. Кажется, в неё не передаётся значение из цикла.</p>]]></description>
			<author><![CDATA[null@example.com (Indrik)]]></author>
			<pubDate>Thu, 19 Feb 2015 18:05:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91696#p91696</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91695#p91695</link>
			<description><![CDATA[<p>А что это за команда? Нигде не могу найти официальное описание. Вроде похоже на какой-то стиль окна, но в списке стилей этой команды нет.<br /></p><div class="quotebox"><blockquote><p>gui, +hwndguihwnd</p></blockquote></div><p>А вот тут:<br /></p><div class="quotebox"><blockquote><p>После выполнения<br />gui, show, w400 center, Сообщение от %sender%<br />return<br />скрипт возвращается к строке<br />WinWaitClose, Сообщение от</p></blockquote></div><p>Вот оно что. А я думал, что этот return относится к самому gui, show. Ну тогда понятно. Правда, получается что фокус выполнения раздваивается: он перешёл на строку WinWaitClose, но при этом одновременно может ожидать закрытия окна, хотя до туда он вообще не дошёл. Не знал, что такое возможно.</p>]]></description>
			<author><![CDATA[null@example.com (Indrik)]]></author>
			<pubDate>Thu, 19 Feb 2015 17:51:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91695#p91695</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91668#p91668</link>
			<description><![CDATA[<div class="quotebox"><cite>Indrik пишет:</cite><blockquote><p>Всё-таки, перезагрузка скрипта, это как-то по-варварски.<br />msgbox не предлагать. <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p></blockquote></div><p> Почему же?</p><p>Вот, может пригодится, мой MsgBox. </p><p><strong>Весь исходный код</strong>(без файлов wav, png) </p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;Функция GMsgBox</div><div class="fancy_spoiler"><div class="codebox"><pre><code>;************************************************************************************
;---------------Начало секции инициализации всех функций-----------------------------
If A_IsCompiled
    {
      vDirGMB  := &quot;AllAddFunc.res\GMsgBox.res&quot;
      IfNotExist, AllAddFunc.res\GMsgBox.res
          {
            FileCreateDir, AllAddFunc.res\GMsgBox.res ; Создаём папку для ресурсов
            FileSetAttrib, +H+A+R, AllAddFunc.res              ; Делаем её архивной, только для чтения и скрытой 
            FileSetAttrib, +H+A+R, AllAddFunc.res\GMsgBox.res  ; Делаем её архивной, только для чтения и скрытой 
          }
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\GMB.ini,       AllAddFunc.res\GMsgBox.res\GMB.ini
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Default.wav,   AllAddFunc.res\GMsgBox.res\Default.wav
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Done.wav,      AllAddFunc.res\GMsgBox.res\Done.wav
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Error.wav,     AllAddFunc.res\GMsgBox.res\Error.wav
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Question.wav,  AllAddFunc.res\GMsgBox.res\Question.wav
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Alert.wav,     AllAddFunc.res\GMsgBox.res\Alert.wav
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Info.wav,      AllAddFunc.res\GMsgBox.res\Info.wav
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Default.png,   AllAddFunc.res\GMsgBox.res\Default.png
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Done.png,      AllAddFunc.res\GMsgBox.res\Done.png
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Error.png,     AllAddFunc.res\GMsgBox.res\Error.png
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Question.png,  AllAddFunc.res\GMsgBox.res\Question.png
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Alert.png,     AllAddFunc.res\GMsgBox.res\Alert.png
      FileInstall, C:\AHK\Include\AllAddFunc.res\GMsgBox.res\Info.png,      AllAddFunc.res\GMsgBox.res\Info.png
    }
  Else
    {
     vDirGMB  := &quot;C:\AHK\Include\AllAddFunc.res\GMsgBox.res&quot;
    }

Goto PointBypass_AllAddFunc  ;Обход активной части модуля

;************************************************************************************
; Подпрограмма иницализации вызвать после подключения по... 
; #Include C:\AHK\Include\AllAddFunc.ahk
;--------Beginning the initialization section of all functions---------------------------------

;--------Beginning of the initialization functions of GMsgBox----------------------------------
Install_GMsgBox:
  fInstall_GMsgBox := False
  
  сMsgOkInfoModal   :=0+8192+64 ;only an OK button + Task Modal + Icon Asterisk(info)
  сMsgOkErModal     :=0+8192+16 ;only an OK button + Task Modal + Icon Hand (stop/error)
  сMsgOkAlertModal  :=0+8192+48 ;only an OK button + Task Modal + Icon Exclamation
  сMsgYNQuestModal  :=4+8192+32 ;Yes/No button  + Task Modal + Icon Question
  сMsgYNInfoModal   :=4+8192+64 ;Yes/No button + Task Modal +  Icon Asterisk (info)
  
  ; Проверка файлов на существование
 ; Описание массива Звук + ICO для простоты вызова 
  ; Simple beep
  cSoundDefault := &quot;Default.wav&quot;,   cIcoDefault  := &quot;Default.png&quot;
  ; Done
  cSoundDone    := &quot;Done.wav&quot;,      cIcoDone    := &quot;Done.png&quot;
  ; Error
  cSoundError   := &quot;Error.wav&quot;,     cIcoError   := &quot;Error.png&quot;,
  ; Question
  cSoundQuest   := &quot;Question.wav&quot;,  cIcoQuest   := &quot;Question.png&quot;,
  ; Alert
  cSoundAlert   := &quot;Alert.wav&quot;,     cIcoAlert   := &quot;Alert.png&quot;
  ; Info
  cSoundInfo  := &quot;Info.wav&quot;,       cIcoInfo    := &quot;Info.png&quot;
  iSetOfButtonMin   := iSetOfButtonBeep  :=1
  iSetOfButtonDone  :=2
  iSetOfButtonError :=3
  iSetOfButtonQuest :=4
  iSetOfButtonAlert :=5
  iSetOfButtonMax   := iSetOfButtonInfo  :=6
  arSoundIco    := [[cSoundDefault,cIcoDefault,&quot;Default&quot;]
                   ,[cSoundDone,cIcoDone,&quot;Done&quot;]
                   ,[cSoundError,cIcoError,&quot;Error&quot;]                   
                   ,[cSoundQuest,cIcoQuest,&quot;Question&quot;]                   
                   ,[cSoundAlert,cIcoAlert,&quot;Alert&quot;]                   
                   ,[cSoundInfo,cIcoInfo,&quot;Info&quot;]]

;Коды комбинаций кнопок, If ((cBtOk || cBtOkC || cBtYN || cBtYNC)&lt;0) Then Left-Most Else Right-Most                   
  cButtonKeyNot := False, cButtonKeyOk   := 1, cButtonKeyOkC  := 2, cButtonKeyYN   := 3, cButtonKeyYNC  := 4

  ;Имена кнопок(можно менять)
iNameEng := 1
iNameRus := 2
  arNameBT  := [[&quot;OK&quot;,&quot;Cansel&quot;,&quot;Yes&quot;,&quot;No&quot;]
              ,[&quot;ОК&quot;,&quot;Отмена&quot;,&quot;Да&quot;,&quot;Нет&quot;]]

Gosub lCheckUsedFiles

fInstall_GMsgBox := True
Return
;-----------End of the initialization functions of GMsgBox--------------------

;--------End of the initialization section of all functions-------------------
;************************************************************************************

;************************************************************************************
;                         Начало описания функций
;************************************************************************************
;------------------Начало определения функции GMsgBox (Свой MsgBox)------------------
GMsgBox(i,TittleGMB,TextGMB
        ,DelayGMB := 30.5, ButtonKey := False, ButtonLng := 2
        ,SizeTextGMB := 12, ColorTextGMB := &quot;000000&quot;, FontWeightTextGMB :=  &quot;300&quot;, FontTextGMB := &quot;Verdana&quot;
        ,SizeButnGMB := 14, ColorButnGMB := &quot;000000&quot;, FontWeightButnGMB :=  &quot;850&quot;, FontButnGMB := &quot;MS sans serif&quot;)
{
Global vDirGMB, arSoundIco, arNameBT, сMsgOkErModal,  iSetOfButtonMin,  iSetOfButtonMax
  ; If ((BtOk || BtOkC || BtYN || BtYNC)&lt;0) Then Left-Most Else Right-Most
  BtNot := False, BtOk   := 1, BtOkC  := 2, BtYN   := 3, BtYNC  := 4
  retDef :=  False ; Значение не определено
  retTimeOut := 100, retOk := retYes := 1, retNo := 2, retESC  := 3, retCross  := 4, retCancel := -1
  
  Gosub lAllCheck ;Проверяем валидность входных данных, т.е. которые можем проверить - выход без условный при ошибке
  DelayGMB := Ceil(Round(DelayGMB,1)*10) ; Коррекция и установка времени задержки с точностью до одной десятой секунды.
  DelayStep := 100 ; Шаг ожидания в цикле, даёт эквивалент для  DelayGMB времени ожидания в секундах
  SoundGMB  := vDirGMB &quot;\&quot; arSoundIco[i,1]   ; Установка звукового сигнала
  PicGMB    := vDirGMB &quot;\&quot; arSoundIco[i,2]   ; Установка титульной картинки

  ButOk      := arNameBT[ButtonLng,1] ; Имя кнопки ОК
  ButCancel  := arNameBT[ButtonLng,2] ; Имя кнопки Cancel
  ButYes     := arNameBT[ButtonLng,3] ; Имя кнопки Yes
  ButNo      := arNameBT[ButtonLng,4] ; Имя кнопки No
  
  If (ButtonKey &lt; 0)        ; Расчёт позиционировани кнопок
        posBT:= &quot;xm y+m&quot;          ; Слева
     Else
        posBT:= &quot;x+m y+m&quot;         ; Справа
        
  ButtonKey := Abs(ButtonKey)   ;Сброс значения кнопок в абсолютное значение
  
  Gosub lCreateGMB    ; Создание окна MsgBox
  Gosub lWaitGMB      ; Ожидание кода возвората по событию или по тайм-ауту
Return  ret

lCreateGMB:
  Gui, New , -maximizebox -minimizebox +AlwaysOnTop +Caption, %TittleGMB%
  Gui, Font, c%ColorTextGMB% s%SizeTextGMB% w%FontWeightTextGMB%, %FontTextGMB%
  Gui, Add, Picture, xm ym, %PicGMB%
  Gui, Add, Text,xm, %TextGMB%
  Gui, Font, c%ColorButnGMB% s%SizeButnGMB% w%FontWeightButnGMB%, %FontButnGMB%
  If (ButtonKey = BtOk)
          Gui, Add, Button, section Default %posBT% gSubOk, &amp;%ButOk%

    Else If (ButtonKey = BtOkC)
            {
              Gui, Add, Button, section Default %posBT% gSubOk, &amp;%ButOk%
              Gui, Add, Button, section Default x+m gSubCancel, %ButCancel%
            }
    Else If (ButtonKey = BtYN)
            {
              Gui, Add, Button, section Default %posBT% gSubYes, &amp;%ButYes%
              Gui, Add, Button, section Default x+m gSubNo, %ButNo%
            }
    Else If (ButtonKey = BtYNC)
            {
              Gui, Add, Button, section Default %posBT% gSubYes, &amp;%ButYes%
              Gui, Add, Button, section Default x+m gSubNo, %ButNo%
              Gui, Add, Button, section Default x+m gSubCancel, %ButCancel%
            }
    Else
      {
       ;Ошибочный код, просто не выводим кнопки, эквивалент BtNot
      }
 
  Gui, Show, AutoSize Center
  SoundPlay %SoundGMB%
  fGMB := False
Return

;Подпрограмма тайм-аута
lWaitGMB:
  Loop %DelayGMB% ; N секунд 
    {
    If (fGMB)
          Break
    Sleep %DelayStep%
   }
  If (ret = retDef) 
        ret :=  retTimeOut
  Gui, Cancel
Return

;Подпрограммы событий нажатия на кнопки
SubOk:
  ret   :=  retOk
  fGMB  := True
Return

SubCancel:
  ret   :=  retCancel
  fGMB  := True
Return

SubYes:
  ret   :=  retYes
  fGMB  := True
Return

SubNo:
  ret   :=  retNo
  fGMB  := True
Return

GuiEscape:
  ret   :=  retESC
  fGMB  := True
Return

GuiClose:
  ret   :=  retCross
  fGMB  := True
Return

;Подпрограмма валидности входных данных
lAllCheck:
  txtErr1 := &quot;Ошибка в при вызове функциии GMsgBox  `n`n&quot;
  txtErr2 := &quot;`n`n`n Критическое завершение программы&quot;
 If (i &lt; iSetOfButtonMin || i &gt; iSetOfButtonMax)
      txtErr0 := &quot;Ошибка в индексе набора звука и иконок&quot;
  Else If (DelayGMB&lt;0)
       txtErr0 := &quot;Ошибка в задержке, она не должана быть отрпицатильным числом&quot;
  Else If (ButtonLng&lt;=0 || ButtonLng&gt;2)
      txtErr0 := &quot;Ошибка в индексе языка кнопок&quot;
  Else If (fInstall_GMsgBox = False)
       txtErr0 := &quot;Ошибка - не проведена ининициализация функции GMsgBox&quot;
  Else 
    Return  ; Всё нормально
    
  MsgBox %  сMsgOkErModal, Ошибка использования GMsgBox
            ,%txtErr1% %txtErr0% %txtErr2%
            ,30
  ExitApp
Return
}
;------------------Конец определения функции GMsgBox (Свой MsgBox)------------------

;---------------Addition to the initialization functions of GMsgBox-----------------
lCheckUsedFiles:                   
; Провеки верности и существования INI-файла, файлов звука и файлов картинок.                   
  vPicGMB       := vDirGMB &quot;\GMB.ini&quot;
  IfNotExist, %vPicGMB%
      {
        MsgBox %  сMsgOkErModal, Ошибка инициализации GMsgBox
            ,&quot;Файл &quot; %vPicGMB% &quot;`n Не существует`n Выход из программы.&quot;
            ,30
        ExitApp
      }

  i := iSetOfButtonMin
  Loop %iSetOfButtonMax%
    {
      vKey := arSoundIco[i,3] ; Имя ключа

;--------  Проверка файла звука
      IniRead, OutputVar, %vPicGMB%, Sound, %vKey%
      If (OutputVar != arSoundIco[i,1])
            {
              MsgBox %  сMsgOkErModal, Ошибка инициализации GMsgBox
                    ,&quot;Неверное названия файла звука &quot; %OutputVar% &quot;`n `n Выход из программы.&quot;
                    ,30
              ExitApp
            }
      vDirTmp := vDirGMB &quot;\&quot; OutputVar
      IfNotExist, %vPicGMB%
            {
              MsgBox %  сMsgOkErModal, &quot;Ошибка инициализации GMsgBox&quot;
                        ,&quot;Файл звука&quot; %vPicGMB% &quot;`n Не существует`n Выход из программы.&quot;
                        ,30
              ExitApp
            }
      
;--------  Проверка файла картинки      
      IniRead, OutputVar, %vPicGMB%, Picture, %vKey%
      If (OutputVar != arSoundIco[i,2])
            {
              MsgBox %  сMsgOkErModal, Ошибка инициализации GMsgBox
                    ,&quot;Неверное названия файла картинки &quot; %OutputVar% &quot;`n `n Выход из программы.&quot;
                    ,30
              ExitApp
            }
      vDirTmp := vDirGMB &quot;\&quot; OutputVar
      IfNotExist, %vPicGMB%
            {
              MsgBox %  сMsgOkErModal, &quot;Ошибка инициализации GMsgBox&quot;
                        ,&quot;Файл картинки&quot; %vPicGMB% &quot;`n Не существует`n Выход из программы.&quot;
                        ,30
              ExitApp
            }
      i++
    }
Return
;------------End of additions to initialization functions of GMsgBox;---------------


;************************************************************************************
;                         Конец описания функций
;************************************************************************************
PointBypass_AllAddFunc:</code></pre></div></div></div><p>Файл <strong>GMB.ini</strong><br /></p><div class="codebox"><pre><code>[Sound]
Default=Default.wav
Done=Done.wav
Error=Error.wav
Question=Question.wav
Alert=Alert.wav
Info=Info.wav

[Picture]
Default=Default.png
Done=Done.png
Error=Error.png
Question=Question.png
Alert=Alert.png
Info=Info.png</code></pre></div><p><strong>Иницализация. </strong></p><div class="codebox"><pre><code>#Include C:\AHK\Include\AllAddFunc.ahk
Gosub Install_GMsgBox</code></pre></div><p><strong>Примеры вызова.</strong></p><div class="codebox"><pre><code>GMsgBox(iSetOfButtonInfo,&quot;Архивация&quot;,&quot;Старт архивации программы&quot; &quot;`n`n`t &quot; vGenNameIn,1.5)

GMsgBox(iSetOfButtonError,&quot;Ошибка выполнения программы&quot;, vTxtErr  &quot;`n`n Код ошибки = &quot; vExitCode,,-cButtonKeyOk)</code></pre></div><p>Может пригодиться, есть код возврата по событию.</p><p>P.S. Убраны остальные функции, не относящиеся к делу.</p>]]></description>
			<author><![CDATA[null@example.com (Indomito)]]></author>
			<pubDate>Wed, 18 Feb 2015 19:31:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91668#p91668</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91660#p91660</link>
			<description><![CDATA[<p><strong>Indrik</strong>, каждый раз создавать и разрушать Gui — это из той же оперы, что Reload для продолжения цикла. Гуи создают один раз, а потом только показывают или прячут по мере необходимости. Обработчики кнопок помещать внутрь цикла — это тоже не дело. Попробуйте вот этот вариант:<br /></p><div class="codebox"><pre><code>
#SingleInstance force
#NoEnv
SetBatchLines, -1
SetTitleMatchMode, 3

path = C:\Share
sender = Джубадзе
name = message.txt
col = navy
font = Calibri

setworkingdir, %path%

gui, +hwndguihwnd
gui, font, s14 c%col%, %font%
gui, add, text, w380 center, %file%
gui, add, button, x155 default, Хорошо!

loop
{
    sleep, 2000
    ifexist, %name%
    {
        fileread, file, %name%
        if file
        {
            gui, show, w400 center, Сообщение от %sender%
            winwaitclose, ahk_id %guihwnd%
        }
    }
}

buttonХорошо!:
guiclose:
gui, hide
filedelete, %name%
return

</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Wed, 18 Feb 2015 04:25:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91660#p91660</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91657#p91657</link>
			<description><![CDATA[<p>Я не понимаю про какой мой return вы говорите.<br />Для GoSub нету понятия его return или не его, если по пути не встретился другой GoSub.<br />После выполнения<br /></p><div class="codebox"><pre><code>gui, show, w400 center, Сообщение от %sender%
return</code></pre></div><p>скрипт возвращается к строке<br /></p><div class="codebox"><pre><code>WinWaitClose, Сообщение от</code></pre></div><p>и соответственно ждет, когда вы закроете гуи.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 18 Feb 2015 00:47:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91657#p91657</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91656#p91656</link>
			<description><![CDATA[<p>Почитал. Ничего нового не вычитал. Что вы имеете в виду?<br />gosub, label1 переводит выполнение на подпрограмму, начинающуюся с label1: и заканчивающуюся return. Когда скрипт встречает return, он возвращается к той строке, что идёт сразу после вызова подпрограммы. Вот только ваш return относится не к подпрограмме, а к блоку buttonХорошо! (по крайней мере, по принципу вложенности, это должно быть так), который, как известно, требует return в обязательном порядке.<br />...к тому же, выполнение же всё равно зациклится на блоке buttonХорошо!... (он же не изменился)<br />Ладно, иду спать, завтра буду пробовать, может что и получится. Спасибо за советы. Отпишусь.</p>]]></description>
			<author><![CDATA[null@example.com (Indrik)]]></author>
			<pubDate>Wed, 18 Feb 2015 00:36:30 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91656#p91656</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91655#p91655</link>
			<description><![CDATA[<p>Почитайте внимательнее про GoSub.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 18 Feb 2015 00:25:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91655#p91655</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91654#p91654</link>
			<description><![CDATA[<p>Попробую, но вряд ли это сработает. Если выполнение зацикливалось в блоке buttonХорошо!-return раньше, то что ему мешает зациклиться там и в вашем варианте? До команды winwaitclose дело просто не дойдёт, как не доходило у меня до закрывающих фигурных скобок.<br />И потом, где у вас второй return? Первый (в самом низу) относится к блоку buttonХорошо!, а за ним по идее должен идти второй, который будет относится уже к подпрограмме Gui, разве нет?<br />Нужно как-то выйти из блока buttonХорошо!-return так, чтобы подпрограмма закрылась и для новой не выделялось новое место в памяти. Команда continue не помогает, как и exit, break, и дополнительный return.</p>]]></description>
			<author><![CDATA[null@example.com (Indrik)]]></author>
			<pubDate>Wed, 18 Feb 2015 00:14:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91654#p91654</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Продолжение работы скрипта после нажатия кнопки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=91653#p91653</link>
			<description><![CDATA[<div class="codebox"><pre><code>SetTitleMatchMode, 2
Gosub, Gui
WinWaitClose, Сообщение от
Msgbox Продолжение цикла
ExitApp
 
Gui:
gui, font, s14 c%col%, %font%
gui, add, text, w380 center, %file%
gui, add, button, x155 default, Хорошо!
gui, show, w400 center, Сообщение от %sender%
return

buttonХорошо!:
guiclose:
gui, destroy
filedelete, %name%
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 17 Feb 2015 23:51:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=91653#p91653</guid>
		</item>
	</channel>
</rss>
