<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10498</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10498&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: интеллигентное закрытие скрипта при выходе из программы.».]]></description>
		<lastBuildDate>Sun, 15 Mar 2015 03:24:28 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92536#p92536</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>А как же SetWinEventHook?</p></blockquote></div><p>Не в курсе.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sun, 15 Mar 2015 03:24:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92536#p92536</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92535#p92535</link>
			<description><![CDATA[<p>Почему бы не использовать &quot;process,exist&quot;?</p><p>OFF: Вечно я отписываюсь не обновляя страницу...</p>]]></description>
			<author><![CDATA[null@example.com (Alectric)]]></author>
			<pubDate>Sat, 14 Mar 2015 18:48:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92535#p92535</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92534#p92534</link>
			<description><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p>Ни диалог, ни кнопка не принадлежат скрипту, поэтому и отправлять в него ничего не будут.</p></blockquote></div><p>А как же SetWinEventHook? Есть EVENT_SYSTEM_CAPTUREEND, есть также EVENT_SYSTEM_DIALOGSTART и EVENT_SYSTEM_FOREGROUND для того чтобы не проверять более частые CAPTUREEND. Также данный хук запускает поток даже при отображении скриптом своего меню.<br /></p><div class="quotebox"><cite>Kamagi пишет:</cite><blockquote><p>чтобы при закрытии программы ... AHK-скрипт закрывался автоматически.</p></blockquote></div><p>А зачем тут привязка к окнам, если нужно всего лишь следить за наличием процесса данной программы?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 14 Mar 2015 18:45:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92534#p92534</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92533#p92533</link>
			<description><![CDATA[<p>Можно и так сделать. У каждой программы своя специфика (np++ сохраняет практически мгновенно), к тому же практически любая задача имеет более чем 1 решение. <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Sat, 14 Mar 2015 18:22:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92533#p92533</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92532#p92532</link>
			<description><![CDATA[<p><strong>Irbis</strong>, разобрался. Признаю, я затупил, ваш скрипт работает, но тем не менее его необходимо доработать. В случае, если при закрытии программы мне необходимо сохранить редактируемый файл, и эта операция занимает более секунды, скрипт не выгружается. Вопрос решается проверкой существования диалогового окна сохранения файла:</p><div class="codebox"><pre><code>^q::
   Send !{F4}
   sleep 1000 
   WinWaitClose, CINEMA 4D Studio
   sleep 1000
   ifWinExist, Save File
        ExitApp
   IfWinNotExist, CINEMA 4D R16.011 Studio (R16)
        ExitApp
Return </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Kamagi)]]></author>
			<pubDate>Sat, 14 Mar 2015 17:50:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92532#p92532</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92531#p92531</link>
			<description><![CDATA[<div class="quotebox"><cite>Kamagi пишет:</cite><blockquote><p>...Скрипт #4 характерен тем, что если пользователь на время существования диалогового окна в течении 2-ух секунд не принял решения (затупил, отвлёкся, мало ли), то при закрытии программы скрипт не закрывается.</p></blockquote></div><p>Значит, неправильно указаны заголовки окон в #1. У меня в notepad++ нажатие на F10 работает, как задумано.</p><div class="codebox"><pre><code>F10::
   Send !{F4}
   sleep 1000 
   WinWaitClose, Save ahk_exe notepad++.exe 
   sleep 1000
   IfWinNotExist, ahk_exe notepad++.exe
      ExitApp
Return </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Sat, 14 Mar 2015 17:24:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92531#p92531</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92530#p92530</link>
			<description><![CDATA[<div class="quotebox"><cite>Kamagi пишет:</cite><blockquote><p> ...Учтены, кажется, все возможные варианты развития событий...</p></blockquote></div><p>Да у вас даже принадлежность кнопки к окну не проверяется, равно как и заголовок активного окна при нажатии Esc. А ведь пользователь может и в другое окно ткнуть курсором. Образно говоря, велосипед, кроме авторской патентованной конструкции, комплектуется набором граблей для удобного на них наезжания, при полном отсутствии активной обороны от них в виде программных костылей. ))</p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Sat, 14 Mar 2015 17:14:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92530#p92530</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92528#p92528</link>
			<description><![CDATA[<p><strong>Malcev</strong>,<br />сие для меня пока что трудновато, но поковырять желание появилось. Спасибо за ссылку. </p><p><strong>Irbis</strong>,<br />разве изобретать свой велосипед не интересней, чем брать уже готовый? Скрипт #4 характерен тем, что если пользователь на время существования диалогового окна в течении 2-ух секунд не принял решения (затупил, отвлёкся, мало ли), то при закрытии программы скрипт не закрывается. Мой последний вариант исключает подобную возможность.</p>]]></description>
			<author><![CDATA[null@example.com (Kamagi)]]></author>
			<pubDate>Sat, 14 Mar 2015 16:46:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92528#p92528</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92526#p92526</link>
			<description><![CDATA[<p>Нет, не понять мне желания некоторых пользователей изобрести свой велосипед с квадратными колесами, и ездить на нем по ухабам без седушки.</p><p><strong>Kamagi</strong>, если бы ваша наблюдательность хоть бы на малость приблизилась по величине к вашей тяге к эпистолярному жанру, вы бы заметили, что в приведенном в #4 коде &quot;бесконечное&quot; ожидание происходит лишь в момент нажатия хоткея, и длится не более, чем существует диалоговое окно. Никакого цикла не крутится, следовательно - напряженности и взаимонедопонимания между скриптом и другими потребителями ресурсов не возникает.</p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Sat, 14 Mar 2015 16:09:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92526#p92526</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92524#p92524</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Да, но это как раз вариант с временным интервалом, в течении которого надо принять решение - закрываю программу или нет. Работоспособно, но интересно, возможно ли без него?</p></blockquote></div><p><a href="http://forum.script-coding.com/viewtopic.php?id=8326">http://forum.script-coding.com/viewtopic.php?id=8326</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 14 Mar 2015 12:12:19 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92524#p92524</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92523#p92523</link>
			<description><![CDATA[<p>Хоткей тоже может работать на время существования диалога. Для этого есть команда Hotkey.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sat, 14 Mar 2015 12:11:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92523#p92523</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92522#p92522</link>
			<description><![CDATA[<p><strong>YMP</strong>, <br />В моём варианте цикл работает только на время существования диалогового окна сохранения файла, что не очень страшно. WinWaitClose не запущен на протяжении всей работы, что на мой взгляд тоже хорошо. Учтены, кажется, все возможные варианты развития событий, и скрипт выгружается только в случае, если программа действительно закрылась. В любом случае, спасибо за ответы. </p><p><strong>ypppu</strong>,<br />Хммм...</p>]]></description>
			<author><![CDATA[null@example.com (Kamagi)]]></author>
			<pubDate>Sat, 14 Mar 2015 11:40:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92522#p92522</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92521#p92521</link>
			<description><![CDATA[<p>Полагаю, решил, как и хотел, ха-ха!</p><div class="quotebox"><blockquote><p>^q::<br />Send ! {F4}&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;### Посылаем закрытие проги, ею выводится диалоговое окно <br />loop&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;### Бесконечный цикл<br />{<br />GetKeyState, LMB, LButton&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;### Проверяем нажатие кнопки мыши<br />if LMB = D&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;### Если нажата<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; MouseGetPos, , , , Button&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;### Ищем название кнопки под курсором<br />&nbsp; &nbsp; if (Button = &quot;Button1&quot; or Button = &quot;Button2&quot;)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;### Если это &quot;Да&quot; или &quot;Нет&quot; <br />&nbsp; &nbsp; &nbsp; &nbsp; ExitApp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;### Закрывает скрипт<br />&nbsp; &nbsp; else&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;### Во всех остальных случаях возврат<br />&nbsp; &nbsp; &nbsp; &nbsp; Return<br />&nbsp; &nbsp; }<br />else GetKeyState, Esc, Esc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;### Проверяем, нажат ли Esc<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; if Esc = D&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;### Если да, то возврат<br />&nbsp; &nbsp; &nbsp; &nbsp; Return<br />&nbsp; &nbsp; else&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;### Если нет, возврат в начало цикла<br />&nbsp; &nbsp; &nbsp; &nbsp; Continue<br />&nbsp; &nbsp; }<br />}</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (Kamagi)]]></author>
			<pubDate>Sat, 14 Mar 2015 11:29:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92521#p92521</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92520#p92520</link>
			<description><![CDATA[<div class="quotebox"><cite>Kamagi пишет:</cite><blockquote><div class="codebox"><pre><code>if A_ThisHotkey = MButton</code></pre></div><p>Но эта конструкция, конечно, не работает.</p></blockquote></div><p>У меня работает.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Sat, 14 Mar 2015 10:59:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92520#p92520</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: интеллигентное закрытие скрипта при выходе из программы.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92519#p92519</link>
			<description><![CDATA[<p>Хоткей на левую кнопку и есть отслеживание клика мышкой. Ну, допустим, реализуете вы то же самое через, интеллигентно выражаясь, анальный проход <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> и что вам это даст, кроме спортивной гордости?</p><p>Кстати, хоткей ведь можно временно назначать командой Hotkey, потом убирать.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sat, 14 Mar 2015 10:47:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92519#p92519</guid>
		</item>
	</channel>
</rss>
