<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Другое действие при нажатии кнопки закрытия программы]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11203&amp;type=atom" />
	<updated>2016-01-04T16:12:18Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11203</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Другое действие при нажатии кнопки закрытия программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100158#p100158" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>OmTatSat пишет:</cite><blockquote><p>возвращает 0, 12, или 14 почему так может быть?</p></blockquote></div><p>Потому что есть такие коды, видимо.<br /></p><div class="codebox"><pre><code>
#define HTNOWHERE  0
#define HTTOP  12
#define HTTOPRIGHT  14
</code></pre></div><p>Если код кнопки закрытия не возвращается, то о причине можно только гадать. В принципе, приложение может и само обрабатывать эти сообщения и возвращать любое значение или вообще никакого, если его автор видит в этом какой-то смысл.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2016-01-04T16:12:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100158#p100158</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Другое действие при нажатии кнопки закрытия программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100155#p100155" />
			<content type="html"><![CDATA[<p>Спасибо за подсказку с меседжбоксом.</p><p>с этим кодом </p><div class="codebox"><pre><code>#IfWinActive ahk_exe PotPlayerMini64.exe
LButton::
CoordMode, Mouse, Screen
MouseGetPos, mX, mY, Hwnd
SendMessage, 0x84,, (mX &amp; 0xFFFF)|(mY &amp; 0xFFFF)«16,, ahk_exe PotPlayerMini64.exe
MsgBox, %errorlevel%
If ErrorLevel=14 ; close
ToolTip, work
else
Send {LButton Down}
KeyWait LButton		;physical state
Send {LButton Up}
Return</code></pre></div><p>возвращает 0, 12, или 14 почему так может быть?</p><p>С кодом который писал раньше в ErrorLevel всегда одно значение куда бы не кликнул</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2016-01-04T15:29:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100155#p100155</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Другое действие при нажатии кнопки закрытия программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100151#p100151" />
			<content type="html"><![CDATA[<p>С другими программами работает? У меня да. Что возвращает ваш плеер — см. содержимое ErrorLevel через MsgBox.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2016-01-04T13:35:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100151#p100151</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Другое действие при нажатии кнопки закрытия программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100150#p100150" />
			<content type="html"><![CDATA[<p><strong>YMP</strong> как сохранить ErrorLevel в переменную пока не знаю, но пробовал убрать условие вообще, то-есть без строки </p><div class="quotebox"><blockquote><p>if ( m_hw_target = WinExist( &quot;ahk_exe PotPlayerMini64.exe&quot; ) )</p></blockquote></div><p>ничего не поменялось</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2016-01-04T12:26:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100150#p100150</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Другое действие при нажатии кнопки закрытия программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100149#p100149" />
			<content type="html"><![CDATA[<p><strong>OmTatSat</strong><br />Значение ErrorLevel, вероятно, теряется после выполнения WinExist. Попробуйте сохранять его в специальную переменную.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2016-01-04T09:53:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100149#p100149</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Другое действие при нажатии кнопки закрытия программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=100147#p100147" />
			<content type="html"><![CDATA[<p>Есть проигрыватель PotPlayer, после клика по видео запуск в нём требует несколько секунд. Привык к мгновенному запуску VLC. Если PotPlayer плеер не закрывать, то запуск видео происходит быстрее, идея в том, чтобы при закрытии плеер просто скрывался - ждал запуска следующего файла, как такое можно реализовать?</p><p>пробовал использовать такой код</p><div class="codebox"><pre><code>~RButton::
   CoordMode, Mouse, Screen
   MouseGetPos, m_x, m_y, m_hw_target

   ; WM_NCHITTEST
   SendMessage, 0x84,, ( m_y &lt;&lt; 16 )|m_x,, ahk_id %m_hw_target%
   
   if ( m_hw_target = WinExist( &quot;ahk_exe PotPlayerMini64.exe&quot; ) )
   {
      if ( ErrorLevel = 2 )          ; HTCAPTION
         text = caption
      else if ( ErrorLevel = 3 )      ; HTSYSMENU
         text = system menu
      else if ( ErrorLevel = 8 )      ; HTMINBUTTON
         text = minimize button
      else if ( ErrorLevel = 9 )      ; HTMAXBUTTON
         text = maximize button
      else if ( ErrorLevel = 20 )      ; HTCLOSE
         text = close button
      else if ( ErrorLevel = 21 )      ; HTHELP
         text = help button
      
      if ErrorLevel in 2,3,8,9,20,21
         MsgBox, Hello, Notepad&#039;s %text%!
   }
return</code></pre></div><p>Но ничего не происходит, возможно PotPlayer при нажатии кнопки закрытия не отправляет ErrorLevel? Или отправляет другой код? Как это можно проверить?</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2016-01-04T08:54:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=100147#p100147</id>
		</entry>
</feed>
