<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: GUI - несколько окон и метки GuiClose, GuiEscape, etc.]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7100&amp;type=atom" />
	<updated>2012-04-14T03:45:59Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7100</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GUI - несколько окон и метки GuiClose, GuiEscape, etc.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=59238#p59238" />
			<content type="html"><![CDATA[<p>После часа копания в справке я случайно (раньше не обращал внимания) наткнулся на <strong>Множественные окна GUI</strong> ну и проставил метки &quot;<strong>2</strong>&quot; где&nbsp; было нужно/можно.<br />Это самое простое решение или можно проще или иначе?<br /></p><div class="codebox"><pre><code>ImgWin:
Gui, 2:New ,-caption +Border +AlwaysOnTop,Windows 7
Gui, 2:Add, Picture, gMyPicture AltSubmit, c:\AHK\Icon\windows7.jpg
Gui, 2:font, s14
Gui, 2:Add, Button,  gOk_Img Default ,Ok
Gui, 2:Add, Button,  gCancel_Img xp+300 ,Cancel
ovTxt := arrayKey[fnRetIndexOfLabel(vLbl),сText]
Gui, 2:Add, Text, Center HWNDhTextImg xs yp+50, %ovTxt%
Gui, 2:Show
vImgWin := 0 ; Выполнить действие=1 отмена=2
i := 0
vLoop := 30
while (vImgWin = 0)
 {
  Gui 2:Flash
  sleep 300
  if (i=vLoop)
    vImgWin := 1
  i++  
 }
if (vImgWin = 1)
 GuiControl, 2:Text, %hTextImg%, Выполняется...
if (vImgWin = 2) 
 GuiControl, 2:Text, %hTextImg%, Отмена действия...
sleep 1000
Gui, 2:Cancel
return

2GuiClose:
2GuiEscape: 
vImgWin := 2 ; Отмена
return

MyPicture:
 if A_GuiEvent = Normal
      vImgWin := 1
return

Ok_Img:
 vImgWin := 1
return
 
Cancel_Img: 
 vImgWin := 2 ; Отмена
return</code></pre></div><p>По сути проблема решена.</p>]]></content>
			<author>
				<name><![CDATA[Indomito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27285</uri>
			</author>
			<updated>2012-04-14T03:45:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=59238#p59238</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: GUI - несколько окон и метки GuiClose, GuiEscape, etc.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=59236#p59236" />
			<content type="html"><![CDATA[<p>Например имеем такой код</p><div class="codebox"><pre><code>ImgWin:
Gui, New ,,Windows 7
Gui, Add, Picture, gMyPicture AltSubmit, c:\AHK\Icon\windows7.jpg
Gui, font, s14
Gui, Add, Button,  gOk_Img Default ,Ok
Gui, Add, Button,  gCancel_Img xp+300 ,Cancel
ovTxt := arrayKey[fnRetIndexOfLabel(vLbl),сText]
Gui, Add, Text, CenterHWNDhText xs yp+50, %ovTxt%
Gui, Show
vImgWin := 0 ; Выполнить действие=1 отмена=2
i := 0
vLoop := 30
while (vImgWin = 0)
 {
  Gui Flash
  sleep 300
  if (i=vLoop)
    vImgWin := 1
  i++  
 }
if (vImgWin = 1)
 GuiControl, , %hText%, Выполняется...
if (vImgWin = 2) 
 GuiControl, , %hText%, Отмена действия...
sleep 1000
Gui, Cancel
return

;GuiClose:
GuiEscape: 
vImgWin := 2 ; Отмена
return

MyPicture:
 if A_GuiEvent = Normal
      vImgWin := 1
return

Ok_Img:
 vImgWin := 1
return
 
Cancel_Img: 
 vImgWin := 2 ; Отмена
return</code></pre></div><p>но как для другого окна определить метки типа <strong>GuiClose</strong>, <strong>GuiEscape</strong> и им подобные?</p><p>Я попытался использовать описание типа </p><div class="codebox"><pre><code>Gui, ImgWin:New ,,Windows 7
Gui, ImgWin:Add, Picture, gMyPicture AltSubmit, c:\AHK\Icon\windows7.jpg
Gui, ImgWin:font, s14
Gui, ImgWin:Add, Button,  gOk_Img Default ,Ok
; и т.д.</code></pre></div><p>Скрипт перестал работать вообще, т.е. окно на рисовалось/появилось, а вот реагировать оно ни на что не хотело.<br />Что я сделал не так? <br />Или как правильно надо сделать?</p>]]></content>
			<author>
				<name><![CDATA[Indomito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27285</uri>
			</author>
			<updated>2012-04-14T01:34:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=59236#p59236</id>
		</entry>
</feed>
