<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: не ловит окно IE "Сохранить как"]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16702&amp;type=atom" />
	<updated>2021-11-03T18:29:11Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16702</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: не ловит окно IE "Сохранить как"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150434#p150434" />
			<content type="html"><![CDATA[<p>Тут не в классе дело, а в том, что окно является принадлежащим другому окну (owned) и при появлении препятствует действиям пользователя в основном окне. Чаще всего такие окна имеют класс #32770, но это не обязательно.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-11-03T18:29:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150434#p150434</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: не ловит окно IE "Сохранить как"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150432#p150432" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Можно немного объяснить про &quot;модальные окна&quot;, это все с классом &#039;#32770&#039; я так понимаю?</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-11-03T18:22:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150432#p150432</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: не ловит окно IE "Сохранить как"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150415#p150415" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Вы прямо Всеведущий Мудрец по AHK! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Всегда подскажите как решить проблему.<br />Спасибо большое! Все отлично работает!</p>]]></content>
			<author>
				<name><![CDATA[CyberGudini]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42079</uri>
			</author>
			<updated>2021-11-03T16:11:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150415#p150415</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: не ловит окно IE "Сохранить как"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150411#p150411" />
			<content type="html"><![CDATA[<p>Возможно этот код не реагирует на модальные окна, не вникал. Вот такой работает:<br /></p><div class="codebox"><pre><code>#Persistent
EVENT_OBJECT_SHOW := 0x8002
Hook := new WinEventHook(EVENT_OBJECT_SHOW, EVENT_OBJECT_SHOW, &quot;HookProc&quot;)

HookProc(hWinEventHook, event, hwnd, idObject)
{
   static OBJID_WINDOW := 0
   if (idObject != OBJID_WINDOW)
      Return
   
   WinGetTitle, Title, ahk_id %hwnd%
   WinGetClass, Class, ahk_id %hwnd%
   if (Class = &quot;#32770&quot; &amp;&amp; Title = &quot;Сохранить как&quot;)
      TrayTip, New Window Opened, Title:`t%Title%`nClass:`t%Class%
}

class WinEventHook
{
   __New(eventMin, eventMax, hookProc, idProcess := 0, idThread := 0, dwFlags := 0) {
      this.hHook := DllCall(&quot;SetWinEventHook&quot;, &quot;UInt&quot;, eventMin, &quot;UInt&quot;, eventMax
                                             , &quot;Ptr&quot;, 0, &quot;Ptr&quot;, RegisterCallback(hookProc, &quot;F&quot;)
                                             , &quot;UInt&quot;, idProcess, &quot;UInt&quot;, idThread, &quot;UInt&quot;, dwFlags, &quot;Ptr&quot;)
   }
   __Delete() {
      DllCall(&quot;UnhookWinEvent&quot;, &quot;Ptr&quot;, this.hHook)
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-11-03T15:24:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150411#p150411</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: не ловит окно IE "Сохранить как"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=150410#p150410" />
			<content type="html"><![CDATA[<p>Мне нужно словить событие открытия в браузере IE вспомогательного окна &quot;Сохранить как&quot; (когда мы сохраняем какой-то файл).<br />Вот код:<br /></p><div class="codebox"><pre><code>
#Persistent
Gui +LastFound
hWnd := WinExist()

DllCall( &quot;RegisterShellHookWindow&quot;, UInt,hWnd )
MsgNum := DllCall( &quot;RegisterWindowMessage&quot;, Str,&quot;SHELLHOOK&quot; )
OnMessage( MsgNum, &quot;ShellMessage&quot; )
Return

ShellMessage( wParam,lParam ) {
  Local k
  If ( wParam = 1 ) ;  HSHELL_WINDOWCREATED := 1
     {
       NewID := lParam
       SetTimer, MsgBox, -1
     }
}

MsgBox:
 WinGetTitle, Title, ahk_id %NewID%
 WinGetClass, Class, ahk_id %NewID%
 TrayTip, New Window Opened, Title:`t%Title%`nClass:`t%Class%
Return
</code></pre></div><p>Все окна ловит кроме окна &quot;Сохранить как&quot;.<br />Я могу конечно воспользоваться альтернативой: по таймеру проверять все открытые окна... Но прежде хотелось бы обойтись без этого.<br />Подскажите пожалуйста что можно сделать в данной ситуации?</p>]]></content>
			<author>
				<name><![CDATA[CyberGudini]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42079</uri>
			</author>
			<updated>2021-11-03T14:04:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=150410#p150410</id>
		</entry>
</feed>
