<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Подключение к DOM внешнего HTML документа]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12595&amp;type=atom" />
	<updated>2017-04-13T18:12:29Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=12595</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115049#p115049" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, опять спасибо, сходил, посмотрел, ответил там...<br />А получение исходного кода страницы - это я привел лишь для примера использования подключения к DOM.</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-04-13T18:12:29Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115049#p115049</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115026#p115026" />
			<content type="html"><![CDATA[<p>Если цель просто получить исходный код страницы, то можно через буфер обмена.<br /><a href="http://forum.script-coding.com/viewtopic.php?id=9515">http://forum.script-coding.com/viewtopic.php?id=9515</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-12T13:39:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115026#p115026</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115025#p115025" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, жаль... Установка дополнительного ПО меня совсем не вдохновляет.<br />А за ссылочку - спасибо. Интересный топик, как то я эту темку пропустил...</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-04-12T12:49:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115025#p115025</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115024#p115024" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Ну и задача - максимум: Научиться так же подключаться к DOM структуре документа открытого в Chrome, FireFox и Opera.</p></blockquote></div><p>Насколько мне известно - только через Selenium:<br /><a href="http://forum.script-coding.com/viewtopic.php?id=11530">http://forum.script-coding.com/viewtopic.php?id=11530</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-12T11:26:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115024#p115024</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115023#p115023" />
			<content type="html"><![CDATA[<p>Выкладываю рабочий вариант (может кому пригодится).<br />Выводит список открытых окон Internet Explorer и HTA приложений. После выбора нужного окна выдирает из него HTML содержимое (или все, если на странице отсутствует выделенный фрагмент) и открывает его в редакторе, заданном в IE как дефолтовый HTML редактор (если не задан - то в Блокноте).</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>#Warn
#NoEnv
#SingleInstance Force
SetBatchLines -1

arr := []
WinGet, id, list,,, Program Manager
Loop, %id%
{
	this_id := id%A_Index%
	WinGetClass, this_class, ahk_id %this_id%
	If (this_class = &quot;IEFrame&quot;) {
		WinGetTitle, this_title, ahk_id %this_id%
		arr.push([&quot;IE&quot;,this_title])
	}
	Else If (this_class = &quot;HTML Application Host Window Class&quot;) {
		WinGetTitle, this_title, ahk_id %this_id%
		arr.push([&quot;HTA&quot;,this_title])
	}
}

acount := arr.MaxIndex()
If (!acount) {
	MsgBox 0x30, , Not HTA or Internet Explorer window found!
	ExitApp
}
Else If (acount = 1){
	COM_Connect(arr[1][2])
	ExitApp
}
Else {
	Loop % acount {
		Menu, MyMenu, Add, % arr[A_Index][1] &quot;`t&quot; arr[A_Index][2], MenuHandler
	}
	Menu, MyMenu, Show
	return
}

MenuHandler:
	COM_Connect(RegExReplace(A_ThisMenuItem, &quot;^\S*?\t&quot;, &quot;&quot;))
ExitApp

COM_Connect(win_title){
	pwin := WBGet(win_title)
	If (pwin){
		doc := pwin.document
		; Извлекаем со страницы выделенный текст (если ничего не выделено, то весь)
		html := doc.selection.createRange().htmlText
		If (!html)
			html := doc.documentElement.outerHTML
		; Записываем полученный текст во временный файл
		EnvGet, TEMP, TEMP
		EnvGet, WINDIR, WINDIR
		tmp := % TEMP &quot;\$tmp.html&quot;
		FileDelete, % tmp
		FileAppend, % html, % tmp
		; Находим редактор, заданный для редактирования HTML
		RegRead, editor, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name
		If (!editor)
			editor := % WINDIR &quot;\notepad.exe&quot;
		Run % editor &quot; &quot; tmp
	} else {
		MsgBox 0x30, , Could not connect to DOM!
	}
}

; https://autohotkey.com/board/topic/47052-basic-webpage-controls-with-javascript-com-tutorial/
WBGet(WinTitle=&quot;ahk_class IEFrame&quot;, Svr#=1) {               ; based on ComObjQuery docs
	static msg := DllCall(&quot;RegisterWindowMessage&quot;, &quot;str&quot;, &quot;WM_HTML_GETOBJECT&quot;)
		, IID := &quot;{332C4427-26CB-11D0-B483-00C04FD90119}&quot;   ; IID_IHTMLWindow2 (работает с IE и с HTA)
; 		, IID := &quot;{0002DF05-0000-0000-C000-000000000046}&quot;   ; IID_IWebBrowserApp  (работает только с IE)
	SendMessage msg, 0, 0, Internet Explorer_Server%Svr#%, %WinTitle%
	if (ErrorLevel != &quot;FAIL&quot;) {
		lResult:=ErrorLevel, VarSetCapacity(GUID,16,0), pdoc:=&quot;&quot;
		if DllCall(&quot;ole32\CLSIDFromString&quot;, &quot;wstr&quot;,&quot;{332C4425-26CB-11D0-B483-00C04FD90119}&quot;, &quot;ptr&quot;,&amp;GUID) &gt;= 0 {
			DllCall(&quot;oleacc\ObjectFromLresult&quot;, &quot;ptr&quot;,lResult, &quot;ptr&quot;,&amp;GUID, &quot;ptr&quot;,0, &quot;ptr*&quot;,pdoc)
			return ComObj(9,ComObjQuery(pdoc,IID,IID),1), ObjRelease(pdoc)
		}
	}
}
</code></pre></div></div></div><p>Мой DOM Explorer тоже сейчас подключается к окнам по такому же принципу. Осталось внести лишь несколько косметических правок.</p><p>Ну и задача - максимум: Научиться так же подключаться к DOM структуре документа открытого в Chrome, FireFox и Opera.<br />Буду рад любым идеям и замечаниям по коду.</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-04-12T10:42:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115023#p115023</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=114856#p114856" />
			<content type="html"><![CDATA[<p>Нудным тестированием всех найденных на просторах инета вариантов нашел таки рабочее решение:</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>pwin := WBGet(&quot;ahk_class HTML Application Host Window Class&quot;)
; pwin := WBGet()
If (pwin){
	MsgBox % pwin.document.title
} else {
	MsgBox % &quot;IE or HTA not found!&quot;
	return
}

jstext = 
(
	document.body.onclick = function(){
		ShowElementProps(event.srcElement);
	}
	function ShowElementProps(obj) {
		var props = [];
		for (var p in obj){
			try {
				var v = obj[p];
				if (v) props.push(p + &#039; = &#039; + String(v).substr(0,25));
			} catch (e) {}
		}
		alert(obj.tagName + &#039;\n---------------\n&#039; + props.sort().join(&#039;\n&#039;));
	}
	alert(&#039;JavaScripts loaded!&#039;);
)
jscript := pwin.document.createElement(&quot;script&quot;)
jscript.text := jstext
head := pwin.document.getElementsByTagName(&quot;head&quot;)[0]
head.appendChild(jscript, head)

; https://autohotkey.com/board/topic/47052-basic-webpage-controls-with-javascript-com-tutorial/
WBGet(WinTitle=&quot;ahk_class IEFrame&quot;, Svr#=1) {               ; based on ComObjQuery docs
	static msg := DllCall(&quot;RegisterWindowMessage&quot;, &quot;str&quot;, &quot;WM_HTML_GETOBJECT&quot;)
		, IID := &quot;{332C4427-26CB-11D0-B483-00C04FD90119}&quot;   ; IID_IHTMLWindow2 (работает и IE и с HTA)
; 		, IID := &quot;{0002DF05-0000-0000-C000-000000000046}&quot;   ; IID_IWebBrowserApp  (работает только с IE)
	SendMessage msg, 0, 0, Internet Explorer_Server%Svr#%, %WinTitle%
	if (ErrorLevel != &quot;FAIL&quot;) {
		lResult:=ErrorLevel, VarSetCapacity(GUID,16,0)
		if DllCall(&quot;ole32\CLSIDFromString&quot;, &quot;wstr&quot;,&quot;{332C4425-26CB-11D0-B483-00C04FD90119}&quot;, &quot;ptr&quot;,&amp;GUID) &gt;= 0 {
			DllCall(&quot;oleacc\ObjectFromLresult&quot;, &quot;ptr&quot;,lResult, &quot;ptr&quot;,&amp;GUID, &quot;ptr&quot;,0, &quot;ptr*&quot;,pdoc)
			return ComObj(9,ComObjQuery(pdoc,IID,IID),1), ObjRelease(pdoc)
		}
	}
}</code></pre></div></div></div><p>Теперь надо научиться выводить список всех окон HTA приложений и окон IE в какой нить ListView дабы потом выбирать из него одно, к которому и будет произведено подключение...</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-04-08T20:23:39Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=114856#p114856</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=114809#p114809" />
			<content type="html"><![CDATA[<p>Докладываю: На Win10 мой предыдущий код не работает. Походу он возвращает не COM объект. Пример из справки, который привел <strong>Malcev</strong> - работает, но только с окном IE. C HTA-шкой - ни в какую.</p><p>Сейчас пытаюсь выдрать из кода <a href="http://forum.script-coding.com/viewtopic.php?id=8318">AhkSpy</a> или <a href="https://autohotkey.com/board/topic/77888-accessible-info-viewer-alpha-release-2012-09-20/">AccViewer</a> универсальную процедуру, которая находит и IE и HTA окна. Как, там, ё-мое, все заморочано...<br />Цель всего этого садомазохизма - обеспечить возможность простого (а не такого как сейчас) подключения моего <a href="https://html-applications.bitbucket.io/dom-explorer/readme.html">DOM Explorer</a>-а к любому выбранному HTA/IE окну. Может быть кого то заинтересует? - станете соавтором?</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-04-08T08:47:15Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=114809#p114809</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=114737#p114737" />
			<content type="html"><![CDATA[<p>Вообще связка ahk + html открывает весьма интересные возможности. Оказывается возможно - невозможное - подключение не только к встроенному контролу, а и к DOM стуктуре любой внешней страницы!:</p><div class="codebox"><pre><code>IE := % Connect(&quot;page.html&quot;)
MsgBox % IE.document.body.innerHTML
IE.document.body.innerHTML := &quot;&lt;font color=red&gt;New text on page!&lt;/font&gt;&quot;

Connect(fname) {
	For win in ComObjCreate( &quot;Shell.Application&quot; ).Windows
		If % InStr(win.LocationURL, fname)
			Return win
}</code></pre></div><p> Страничку page.html надо до запуска скрипта открыть в IE </p><div class="codebox"><pre><code>&lt;html&gt;&lt;body&gt;Text on page.&lt;/body&gt;&lt;/html&gt;</code></pre></div><p>Блеск, да и только! Но вот что то с hta я обломался. Не хочет подключаться ни в какую...</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-04-07T07:06:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=114737#p114737</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=114744#p114744" />
			<content type="html"><![CDATA[<p>На работе неинтересно (Win7) и все приведенные примеры работают без вопросов. Домой (Win10) вернусь - буду разбираться почему AhkSpy работает, а скрипт - нет.</p><p>Жаль, конечно, что <strong>serzh82saratov</strong> (автор <a href="http://forum.script-coding.com/viewtopic.php?id=8318">AhkSpy</a>) игнорирует данную тему. Он то научился и к HTA подключаться. Вот только кроме самых основных параметров окна он не пошёл. Да и зачем DOM структура ahk-щику? Меня же, напротив, интересует именно DOM.</p><p>На работе удалось даже к HTA подключиться.<br /></p><div class="codebox"><pre><code>ControlGet, hwnd, HWND, , Internet Explorer_Server1, ahk_class HTML Application Host Window Class
MsgBox % hwnd
IE := WBGet(hwnd)

jstext = 
(
	document.body.onclick = function(){
		ShowElementProps(event.srcElement);
	}
	function ShowElementProps(obj) {
		var props = [];
		for (var p in obj){
			try {
				var v = obj[p];
				if (v) props.push(p + &#039; = &#039; + String(v).substr(0,25));
			} catch (e) {}
		}
		alert(obj.tagName + &#039;\n---------------\n&#039; + props.sort().join(&#039;\n&#039;));
	}
	alert(&#039;JavaScripts loaded!&#039;);
)
jscript := IE.document.createElement(&quot;script&quot;)
jscript.text := jstext
head := IE.document.getElementsByTagName(&quot;head&quot;)[0]
head.appendChild(jscript, head)

WBGet(hwnd) {
	Static IID_IWebBrowserApp := &quot;{0002DF05-0000-0000-C000-000000000046}&quot;
	Static Msg := DllCall(&quot;RegisterWindowMessage&quot;, &quot;Str&quot;, &quot;WM_HTML_GETOBJECT&quot;)
		, IID_IHTMLWindow2 := &quot;{332C4427-26CB-11D0-B483-00C04FD90119}&quot;
	SendMessage, Msg, , , , ahk_id %hwnd%
	DllCall(&quot;oleacc\ObjectFromLresult&quot;, &quot;Ptr&quot;, ErrorLevel, &quot;Ptr&quot;, 0, &quot;Ptr&quot;, 0, PtrP, pdoc)
	Return ComObj(9, ComObjQuery(pdoc, IID_IHTMLWindow2, IID_IHTMLWindow2), 1), ObjRelease(pdoc)
}</code></pre></div><p>Цепляется к последнему запущенному приложению, внедряет в приложение js скрипт и приложение уже работает не как задумано разработчиком, а как надо нам (по щелчку на любом элементе выводит перечень его свойств).</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-04-07T06:43:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=114744#p114744</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=114743#p114743" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Завтра на Win7 попробую</p></blockquote></div><p>А сейчас на чём пробуете?<br />Может такой код из справки пойдёт?<br /></p><div class="codebox"><pre><code>sURL := &quot;https://autohotkey.com/boards/&quot;
if webBrowser := GetWebBrowser()
   webBrowser.Navigate(sURL)
return

GetWebBrowser()
{
    ; Get a raw pointer to the document object of the top-most IE window.
    static msg := DllCall(&quot;RegisterWindowMessage&quot;, &quot;str&quot;, &quot;WM_HTML_GETOBJECT&quot;)
    SendMessage msg, 0, 0, Internet Explorer_Server1, ahk_class IEFrame
    if ErrorLevel = FAIL
        return  ; IE not found.
    lResult := ErrorLevel
    DllCall(&quot;oleacc\ObjectFromLresult&quot;, &quot;ptr&quot;, lResult
        , &quot;ptr&quot;, GUID(IID_IHTMLDocument2,&quot;{332C4425-26CB-11D0-B483-00C04FD90119}&quot;)
        , &quot;ptr&quot;, 0, &quot;ptr*&quot;, pdoc)
    
    ; Query for the WebBrowserApp service. In this particular case,
    ; the SID and IID are the same, but it isn&#039;t always this way.
    static IID_IWebBrowserApp := &quot;{0002DF05-0000-0000-C000-000000000046}&quot;
    static SID_SWebBrowserApp := IID_IWebBrowserApp
    pweb := ComObjQuery(pdoc, SID_SWebBrowserApp, IID_IWebBrowserApp)
    
    ; Release the document object pointer.
    ObjRelease(pdoc)
    
    ; Return the WebBrowser object, wrapped for usability:
    static VT_DISPATCH := 9, F_OWNVALUE := 1
    return ComObject(VT_DISPATCH, pweb, F_OWNVALUE)
}

GUID(ByRef GUID, sGUID) ; Converts a string to a binary GUID and returns its address.
{
    VarSetCapacity(GUID, 16, 0)
    return DllCall(&quot;ole32\CLSIDFromString&quot;, &quot;wstr&quot;, sGUID, &quot;ptr&quot;, &amp;GUID) &gt;= 0 ? &amp;GUID : &quot;&quot;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-06T21:09:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=114743#p114743</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=114742#p114742" />
			<content type="html"><![CDATA[<p>Да, получаю нормально. Еще более странно, что AhkSpy, используя идентичный механизм, подключается без проблем.<br />Завтра на Win7 попробую... Должно подключаться по-любому. Я Ваш код несколько раз перепроверил - все правильно. Странно...</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-04-06T20:52:55Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=114742#p114742</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=114741#p114741" />
			<content type="html"><![CDATA[<p>Странно. А хендл IE получаете?<br /></p><div class="codebox"><pre><code>ControlGet, hwnd, HWND, , Internet Explorer_Server1, ahk_class IEFrame
msgbox % hwnd</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-06T20:39:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=114741#p114741</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=114740#p114740" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, похоже это - как раз то о чем я так долго мечтал. Вот только ругается, гад. на предпоследнюю строчку. &quot;Error: No valid COM object!&quot;</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2017-04-06T20:02:30Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=114740#p114740</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к DOM внешнего HTML документа]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=114739#p114739" />
			<content type="html"><![CDATA[<p>Так еще можно:<br /></p><div class="codebox"><pre><code>f5::
ControlGet, hwnd, HWND, , Internet Explorer_Server1, ahk_class IEFrame
pwin := WBGet(hwnd)
MsgBox % pwin.document.body.outerHTML
 
WBGet(hwnd)   {
    static msg := DllCall(&quot;RegisterWindowMessage&quot;, &quot;str&quot;, &quot;WM_HTML_GETOBJECT&quot;)
        , IID_IHTMLWindow2 := &quot;{332C4427-26CB-11D0-B483-00C04FD90119}&quot;
    SendMessage, msg,,,, ahk_id %hwnd%
    DllCall(&quot;oleacc\ObjectFromLresult&quot;, &quot;Ptr&quot;, ErrorLevel, &quot;Ptr&quot;, 0, &quot;Ptr&quot;, 0, PtrP, pdoc)
    Return ComObj(9,ComObjQuery(pdoc,IID_IHTMLWindow2,IID_IHTMLWindow2),1), ObjRelease(pdoc)
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-06T19:34:47Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=114739#p114739</id>
		</entry>
</feed>
