<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11043&amp;type=atom" />
	<updated>2015-10-30T14:46:35Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11043</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98555#p98555" />
			<content type="html"><![CDATA[<p>Кроме того, по хорошему в условии ещё нужно проверять, твой ли это MsgBox.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-10-30T14:46:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98555#p98555</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98554#p98554" />
			<content type="html"><![CDATA[<p>Так можно закрыть через Ctrl + Enter или Ctrl + Space. Лучше тогда</p><div class="codebox"><pre><code>sleep 1000
MsgBox, 262148, test
return

#IfWinActive, test ahk_class #32770
*space::
*enter::
return
#IfWinActive</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-10-30T14:43:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98554#p98554</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98553#p98553" />
			<content type="html"><![CDATA[<p>Привык к дизайну msgbox.<br /></p><div class="quotebox"><blockquote><p>Пропускать клавиатуру через хук, отслеживая активность MsgBox.</p></blockquote></div><p>Вроде можно без хука:<br /></p><div class="codebox"><pre><code>sleep 1000
MsgBox, 262148, test
return

#IfWinActive, test ahk_class #32770
space::
enter::
return
#IfWinActive</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-30T14:37:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98553#p98553</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98551#p98551" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Задача: при появлении msgbox запретить закрывание его с клавиатуры.</p></blockquote></div><p>Почему нельзя использовать своё окно GUI? Как раз с ним всё проще.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2015-10-30T13:55:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98551#p98551</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98549#p98549" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Задача: при появлении msgbox запретить закрывание его с клавиатуры.</p></blockquote></div><p> Пропускать клавиатуру через хук, отслеживая активность MsgBox.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-10-30T12:32:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98549#p98549</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98539#p98539" />
			<content type="html"><![CDATA[<p>Если быстро нажимать - не пропускает, если зажать и держать - тогда пропускает, думаю это неизбежно и поможет только свое гуи.</p><p>...</p><p>Набросал функцию:<br /></p><div class="codebox"><pre><code>sleep,1000
tooltip,start
msg:=msgbox(&quot;test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test &quot;)
tooltip,done msg = %msg%
sleep,1000


msgbox(text=&quot;&quot;)
{
  gui,99:-sysmenu
  gui,99:add,button,x0 y0 w1 h1,Dummy
  gui,99:add,text,xm ym w300,% text
  gui,99:add,button,xm+130 y+10 w70 h20 g99Ok,Ok
  gui,99:add,button,x+10 yp w70 h20 g99Cencel,Cencel
  gui,99:show

  loop
    sleep,100
    until msg
  gui,99:destroy

  return msg
;  if msg=1
;    return &quot;Ok&quot;
;  else if msg=2
;    return &quot;Cencel&quot;

  99Ok:
  msg=1
  return

  99Cencel:
  msg=2
  return
}


</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-10-30T09:08:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98539#p98539</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98533#p98533" />
			<content type="html"><![CDATA[<p>Хотя, все-равно пропускает.<br />Попробуйте запустить скрипт и быстро нажимать на space.<br /></p><div class="codebox"><pre><code>sleep,1000
SetTimer, DisableMsg, 10
MsgBox, 262148, test,test
return

DisableMsg:
WinActivate, ahk_class Shell_TrayWnd
SetTimer, DisableMsg, Off
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-30T08:53:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98533#p98533</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98530#p98530" />
			<content type="html"><![CDATA[<p>Неужели бывают такие задержки в работе скрипта? Хотя впринципе если и будут, то само появление msgbox задержится.</p><br /><p>Тогда так для надежности:<br /></p><div class="codebox"><pre><code>
SetTimer, DisableMsg, 10
sleep,1000
MsgBox, 262148, test,% c
return

DisableMsg:
c++
WinActivate, ahk_class Shell_TrayWnd
if c&gt;10
{
  SetTimer, DisableMsg, Off
  c=
}
Return


</code></pre></div><br /><br /><p>#6 при загрузке в 100% на одноядерном компе работает корректно. А комп ужасный тормоз, поверьте мне...</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-10-30T08:41:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98530#p98530</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98525#p98525" />
			<content type="html"><![CDATA[<p>Не подходит:<br /></p><div class="codebox"><pre><code>SetTimer, DisableMsg, 10
sleep 1000
MsgBox, 262148, test,test
return

DisableMsg:
WinActivate, ahk_class Shell_TrayWnd
SetTimer, DisableMsg, Off
Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-30T08:24:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98525#p98525</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98524#p98524" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>SetTimer, DisableMsg, 10
MsgBox, 262148, test,test
return

DisableMsg:
WinActivate, ahk_class Shell_TrayWnd
SetTimer, DisableMsg, Off
Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-10-30T08:20:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98524#p98524</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98523#p98523" />
			<content type="html"><![CDATA[<p>Не, блокировать клавиатуру нельзя, так как пока скрипт работает на компьютере тоже работают.<br />Все это нужно для того, чтобы случайно не закрыть этот msgbox при появлении.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-30T08:15:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98523#p98523</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98521#p98521" />
			<content type="html"><![CDATA[<p>А так?<br /></p><div class="codebox"><pre><code>BlockInput On
SetTimer, DisableMsg, -30
MsgBox, 262148, test
Return

DisableMsg:
   WinWait, test ahk_class #32770
   WinActivate, ahk_class Shell_TrayWnd
   BlockInput Off
Return </code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-10-30T08:09:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98521#p98521</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98520#p98520" />
			<content type="html"><![CDATA[<p>Подойдет, но не хотелось бы усложнять.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-30T08:03:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98520#p98520</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98519#p98519" />
			<content type="html"><![CDATA[<p>Вариант с собственным гуи не подойдет? Думаю, можно даже функцию сделать...<br />Например сделать нерабочий элемент (dummy), который будет поумолчанию нажиматься с клавиатуры.</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-10-30T07:47:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98519#p98519</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Запретить закрывание msgbox с клавиатуры в момент его появления]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98516#p98516" />
			<content type="html"><![CDATA[<p>Задача: при появлении msgbox запретить закрывание его с клавиатуры.<br />Такой код срабатывает не всегда (можно успеть нажать space и закрыть.)<br /></p><div class="codebox"><pre><code>SetTimer, DisableMsg, 10
MsgBox, 262148, test
return

DisableMsg:
WinWait, test ahk_class #32770
WinActivate, ahk_class Shell_TrayWnd
SetTimer, DisableMsg, Off
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-30T07:12:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98516#p98516</id>
		</entry>
</feed>
