<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Замена WinWaitClose или IfWinNotExist]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=8326&amp;type=atom" />
	<updated>2013-05-24T05:18:41Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=8326</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72403#p72403" />
			<content type="html"><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd318066(v=vs.85).aspx">Event Constants</a></p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-05-24T05:18:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72403#p72403</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72402#p72402" />
			<content type="html"><![CDATA[<p>Да, так работает.<br />Спасибо!<br />А откуда вы взяли этот параметр - EVENT_OBJECT_DESTROY := 0x8001</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2013-05-24T01:29:27Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72402#p72402</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72399#p72399" />
			<content type="html"><![CDATA[<p>Не принял я во внимание что окно ваше дочернее, ShellProc их не все распознаёт.<br />По счёт этого тоже не уверен:</p><div class="codebox"><pre><code>

EVENT_OBJECT_DESTROY := 0x8001

SetWinEventHook(EVENT_OBJECT_DESTROY, EVENT_OBJECT_DESTROY, 0, RegisterCallback(&quot;HookProc&quot;, &quot;F&quot;), 0, 0, 0)

TargetWinId := WinExist(&quot;Безымянный — Блокнот ahk_class Notepad&quot;)  

   
HookProc(hWinEventHook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime)
{  
    Global TargetWinId
    If (hwnd = TargetWinId)
        ToolTip % hwnd &quot;   =    &quot; TargetWinId
}

SetWinEventHook(eventMin, eventMax, hmodWinEventProc, lpfnWinEventProc, idProcess, idThread, dwFlags)
{
   return DllCall(&quot;SetWinEventHook&quot; , UInt, eventMin
                                    , UInt, eventMax
                                    , Ptr, hmodWinEventProc
                                    , Ptr, lpfnWinEventProc
                                    , UInt, idProcess
                                    , UInt, idThread
                                    , UInt, dwFlags)
}
return

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-05-23T21:24:42Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72399#p72399</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72398#p72398" />
			<content type="html"><![CDATA[<p>Да, не появляется.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2013-05-23T20:38:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72398#p72398</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72397#p72397" />
			<content type="html"><![CDATA[<p>Я правильно понял что при закрытии окна Compressor... ahk_class #32770 ToolTip не появляется.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-05-23T20:34:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72397#p72397</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72396#p72396" />
			<content type="html"><![CDATA[<p>А закрытие блокнота отлавливает.<br />Может окно у audacity специфическое.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2013-05-23T20:28:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72396#p72396</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72395#p72395" />
			<content type="html"><![CDATA[<p>А блокнот</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-05-23T20:16:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72395#p72395</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72394#p72394" />
			<content type="html"><![CDATA[<p>В смысле дальше node = 2 не идет.<br />То есть эта функция не отлавливает закрытие этого окна.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2013-05-23T20:13:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72394#p72394</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72393#p72393" />
			<content type="html"><![CDATA[<p>Что значит зависает на&nbsp; If (nCode = 2). Как это определено?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-05-23T20:11:31Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72393#p72393</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72392#p72392" />
			<content type="html"><![CDATA[<p>Не понимаю.<br />Скрипт зависает на<br /> If (nCode = 2)</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2013-05-23T20:07:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72392#p72392</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72391#p72391" />
			<content type="html"><![CDATA[<p>А можно продолжить отладку и смотреть какое окно убивается:<br /></p><div class="codebox"><pre><code>
DllCall(&quot;RegisterShellHookWindow&quot;, &quot;UInt&quot;, A_ScriptHwnd)
OnMessage(DllCall(&quot;RegisterWindowMessage&quot;, &quot;str&quot;, &quot;SHELLHOOK&quot;), &quot;ShellProc&quot;)

ToolTip % &quot;Id = &quot; TargetWinId := WinExist(&quot;Compressor... ahk_class #32770&quot;)

ShellProc(nCode, wParam)    {
    Global TargetWinId
    If (nCode = 2) 
        ToolTip % wParam &quot;  =?  &quot; TargetWinId 
} 
Return
</code></pre></div><p>и сделать вывод что WinExist в вашем случае определяет Id не того окна. <br />Пробовать сначала активировать окно, и получать Id как WinExist(&quot;A&quot;).<br />Если нет, то получить Id всех окон &quot;Compressor... ahk_class #32770&quot; и копать дальше.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-05-23T19:52:45Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72391#p72391</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72390#p72390" />
			<content type="html"><![CDATA[<p>Winget показывает такой же результат.<br />Кстати хук от уважаемого teadrinker работает.<br />Только надо его как-то изменить под мои нужды.<br /><a href="http://forum.script-coding.com/viewtopic.php?pid=65431#p65431">http://forum.script-coding.com/viewtopi … 431#p65431</a><br /></p><div class="codebox"><pre><code>EVENT_OBJECT_FOCUS := 0x8005

SetWinEventHook(EVENT_OBJECT_FOCUS, EVENT_OBJECT_FOCUS, 0, RegisterCallback(&quot;HookProc&quot;, &quot;F&quot;), 0, 0, 0)

Loop
{
   ToolTip % A_Index
   Sleep, 300
}
   
   
HookProc(hWinEventHook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime)
{
   WinGetClass, class, A
   if (class = &quot;Notepad&quot;)
      ExitApp
}

SetWinEventHook(eventMin, eventMax, hmodWinEventProc, lpfnWinEventProc, idProcess, idThread, dwFlags)
{
   return DllCall(&quot;SetWinEventHook&quot; , UInt, eventMin
                                    , UInt, eventMax
                                    , Ptr, hmodWinEventProc
                                    , Ptr, lpfnWinEventProc
                                    , UInt, idProcess
                                    , UInt, idThread
                                    , UInt, dwFlags)
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2013-05-23T19:42:48Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72390#p72390</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72389#p72389" />
			<content type="html"><![CDATA[<p>После того как получили Id проверьте нужное окно другим инструментом и сравните их Id.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-05-23T19:31:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72389#p72389</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72388#p72388" />
			<content type="html"><![CDATA[<p>Не, не делал.<br />Показывает: Id = 0x43188a</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2013-05-23T19:26:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72388#p72388</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Замена WinWaitClose или IfWinNotExist]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72387#p72387" />
			<content type="html"><![CDATA[<p>Вы хотя бы отладку какую-то делали?:</p><div class="codebox"><pre><code>
DllCall(&quot;RegisterShellHookWindow&quot;, &quot;UInt&quot;, A_ScriptHwnd)
OnMessage(DllCall(&quot;RegisterWindowMessage&quot;, &quot;str&quot;, &quot;SHELLHOOK&quot;), &quot;ShellProc&quot;)

ToolTip % &quot;Id = &quot; TargetWinId := WinExist(&quot;Compressor... ahk_class #32770&quot;)

ShellProc(nCode, wParam)    {
    Global TargetWinId
    If (nCode = 2)
    {    
        If (wParam = TargetWinId)
            MsgBox Close TargetWinId
    }  
} 
Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-05-23T19:21:15Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72387#p72387</id>
		</entry>
</feed>
