<?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=11939&amp;type=atom" />
	<updated>2016-08-26T10:42:49Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11939</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107055#p107055" />
			<content type="html"><![CDATA[<p>Бесконечно благодарен! Сделал закладку на этот топик. Обязательно ознакомлюсь с таким нужным материалом.</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-08-26T10:42:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107055#p107055</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107053#p107053" />
			<content type="html"><![CDATA[<p>Так как в хроме отсутствует у кнопки &quot;закрыть&quot; action, то можно вычислить координаты кнопки &quot;закрыть&quot; и послать туда ControlClick.<br /></p><div class="codebox"><pre><code>SetBatchLines, -1
Window := &quot;ahk_class Chrome_WidgetWin_1&quot;
Role := 60  ; ROLE_SYSTEM_PAGETABLIST

f1::
AccObj := Acc_ObjectFromWindow(WinExist(Window))
AccElem := SearchElement(AccObj, Role)
count := AccElem.accChildCount
WinGetPos, Xwin, Ywin,,, %Window%  
loop % count - 2
{
   last := Acc_Children(AccElem)[count]
   oCoords := Acc_Location(Acc_Child(last, 4))
   X := oCoords.x - Xwin + oCoords.w//4
   Y := oCoords.y - Ywin + oCoords.h//2
   ControlClick, x%X% y%Y%, %Window%,,,,NA
   count--
   sleep 200
}
return


SearchElement(ParentElement, Role)
{
   If (ParentElement.accRole(0) = Role)
      Return ParentElement

   for k, v in Acc_Children(ParentElement)
      if obj := SearchElement(v, Role)
         Return obj
}</code></pre></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><br /><a href="https://autohotkey.com/boards/viewtopic.php?f=5&amp;t=11884">https://autohotkey.com/boards/viewtopic … mp;t=11884</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-08-26T04:00:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107053#p107053</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107052#p107052" />
			<content type="html"><![CDATA[<p>Очень исчерпывающе. Зачитался, ушёл по ссылкам МСДН, в итоге долго тупил, пока не обратил внимание, что &quot;Acc_Children()&quot; - возвращает массив дочерних объектов, а не просто объект. Тогда:<br /></p><div class="codebox"><pre><code>
Acc_Children(AccElem)[2].accName(0)
Acc_Children(AccElem)[2].accValue(0)
</code></pre></div><p>дают мне значения для анализа, но, имена открывающихся вкладок всегда идентичны, потому как открывают один и тот же адрес, а значение в &quot;accValue(0)&quot; - всегда пустое. Остаётся делать вывод только на основании того, что значение в &quot;accChildCount&quot; больше 2 и ненужная мне вкладка браузера открывается всегда последней.</p><p>Скажите пожалуйста, можно ли закрыть вкладку на уровне объекта, или овчинка выделки не стоит и проще брать окно в фокус с последующим &quot;Ctrl+ TabNum&quot; =&gt; &quot;Ctrl+W&quot;?</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-08-25T22:10:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107052#p107052</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107043#p107043" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Не поясните, чем она лучше</p></blockquote></div><p>Да ничем наверное. Этот код писал teadrinker. И так было в оригинале.<br /></p><div class="quotebox"><blockquote><p>Откуда взято &quot;Role := 60&quot; и где посмотреть значения для других ролей?</p></blockquote></div><p>Это константы. Можно посмотреть через AhkSpy с нашего форума, либо тут их список:<br /><a href="https://autohotkey.com/board/topic/77303-acc-library-ahk-l-updated-09272012/">https://autohotkey.com/board/topic/7730 … -09272012/</a><br /></p><div class="quotebox"><blockquote><p>Как закрыть ненужные мне вкладки, имея лишь &quot;accChildCount&quot; - их количество?</p></blockquote></div><p>Надо определиться, какое различие между нужными и ненужными, от него и отталкиваться.<br /></p><div class="quotebox"><blockquote><p>Что обозначает комментарий - &quot;; параметры, начиная со второго: Role, Name, Value&quot; - ?</p></blockquote></div><p>Что аргументы идут со второго параметра функции.<br /></p><div class="quotebox"><blockquote><p>Как узнать другие поля объекта? Как узнать, какие вообще есть?</p></blockquote></div><p><a href="https://autohotkey.com/board/topic/77888-accessible-info-viewer-alpha-release-2012-09-20/">https://autohotkey.com/board/topic/7788 … 012-09-20/</a><br /><a href="https://github.com/Drugoy/Autohotkey-scripts-.ahk/blob/master/DevTools/AccViewer.ahk">https://github.com/Drugoy/Autohotkey-sc … Viewer.ahk</a><br /></p><div class="quotebox"><blockquote><p>В библиотеке &quot;Acc&quot; нет &quot;accName()&quot; и &quot;accValue()&quot;. Каким образом к ним идёт обращение в таком случае?</p></blockquote></div><p> Это свойства:<br /><a href="https://msdn.microsoft.com/en-us/library/accessibility.iaccessible.accname(v=vs.110).aspx">https://msdn.microsoft.com/en-us/librar … .110).aspx</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-08-24T23:45:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107043#p107043</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107042#p107042" />
			<content type="html"><![CDATA[<p>Вот как! Не знал о таком способе записи. Спасибо. Не поясните, чем она лучше:<br /></p><div class="codebox"><pre><code>
a:=1
found := 1
if (a == 1)
	found := 0
msgbox % found
</code></pre></div><p>кроме однострочности? И было бы под завязку хорошо, если бы Вы до конца удовлетворили моё любопытство: <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br /></p><div class="quotebox"><cite>KusochekDobra пишет:</cite><blockquote><p>...<br />Откуда взято &quot;Role := 60&quot; и где посмотреть значения для других ролей?<br />Как закрыть ненужные мне вкладки, имея лишь &quot;accChildCount&quot; - их количество?<br />Как узнать, какая из них - нужна мне?<br />Что обозначает комментарий - &quot;; параметры, начиная со второго: Role, Name, Value&quot; - ?<br />Как узнать другие поля объекта? Как узнать, какие вообще есть?<br />В библиотеке &quot;Acc&quot; нет &quot;accName()&quot; и &quot;accValue()&quot;. Каким образом к ним идёт обращение в таком случае?</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-08-24T23:26:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107042#p107042</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107041#p107041" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>(k = 1 &amp;&amp; ParentElement.accRole(0) != v &amp;&amp; found := &quot;&quot;)</code></pre></div><p>Суть записи такова, что если k = 1 и роль не равна 60, то переменной found присваивается пустота.<br />Вот на более простом примере:<br /></p><div class="codebox"><pre><code>a:=1
found := 1
(a = 1 &amp;&amp; found := 0)
msgbox % found

a:=0
found := 1
(a = 1 &amp;&amp; found := 0)
msgbox % found</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-08-24T23:01:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107041#p107041</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107040#p107040" />
			<content type="html"><![CDATA[<p>Функционально-то понятно, что в цикле происходит прогон по массиву параметров сравниваемых со значениями, хранящимися в полях объекта, но по завершении цикла, &quot;found&quot; всегда будет равен 1, потому как операции присваивания иного значения не описано, или всегда пустое значение, если в конце строки присваивается &quot;&quot;. Или, что более вероятно - я просто не улавливаю суть этой записи, к чему и был посвящён этот вопрос. Моё понимание описывает мне булевские операции внутри всех скобок цикла, но сам результат работы функции говорит об обратном. В общем, я запутался. Вы мне дали конфету, прозрачная упаковка которой явственно демонстрирует её начинку, но забыли показать, как эту упаковку вскрыть и теперь я большими, полными надежды глазами смотрю на неё глотая слюнки. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Простите, что не оправдал Ваших ожиданий, но я обычный нуб постигающий доселе неизвестное по справке.</p><p>Откуда взято &quot;Role := 60&quot; и где посмотреть значения для других ролей?<br />Как закрыть ненужные мне вкладки, имея лишь &quot;accChildCount&quot; - их количество?<br />Как узнать, какая из них - нужна мне?<br />Что обозначает комментарий - &quot;; параметры, начиная со второго: Role, Name, Value&quot; - ?<br />Как узнать другие поля объекта? Как узнать, какие вообще есть?<br />В библиотеке &quot;Acc&quot; нет &quot;accName()&quot; и &quot;accValue()&quot;. Каким образом к ним идёт обращение в таком случае?</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-08-24T22:50:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107040#p107040</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107038#p107038" />
			<content type="html"><![CDATA[<p>Перебираем роли элементов acc объекта, при нахождении нужного нам, возвращаем дочерний объект.<br />Хендл не получите, но можете закрыть ненужные вам вкладки.<br />А вообще для всеядности лучше так:<br /></p><div class="codebox"><pre><code>SetBatchLines, -1
Window := &quot;ahk_class Chrome_WidgetWin_1&quot;
Role := 60  ; ROLE_SYSTEM_PAGETABLIST

AccObj := Acc_ObjectFromWindow(WinExist(Window))
AccElem := SearchElement(AccObj, Role)
msgbox % AccElem.accChildCount - 1

SearchElement(ParentElement, Role)
{
   If (ParentElement.accRole(0) = Role)
      Return ParentElement

   for k, v in Acc_Children(ParentElement)
      if obj := SearchElement(v, Role)
         Return obj
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-08-24T21:27:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107038#p107038</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107028#p107028" />
			<content type="html"><![CDATA[<p>Благодарю! В старом режиме работает. Но как получить HWND вкладок? И разъясните пожалуйста глупому эту запись:<br /></p><div class="codebox"><pre><code>
(k = 1 &amp;&amp; ParentElement.accRole(0) != v &amp;&amp; found := &quot;&quot;)
</code></pre></div><p>Если не сложно, дословно, что конкретно, пошагово выполняется.</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-08-24T17:58:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107028#p107028</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107021#p107021" />
			<content type="html"><![CDATA[<p>Нужен acc.ahk<br /></p><div class="codebox"><pre><code>;------------------------------------------------------------------------------
; Acc.ahk Standard Library
; by Sean
; Updated by jethrow:
; 	Modified ComObjEnwrap params from (9,pacc) --&gt; (9,pacc,1)
; 	Changed ComObjUnwrap to ComObjValue in order to avoid AddRef (thanks fincs)
; 	Added Acc_GetRoleText &amp; Acc_GetStateText
; 	Added additional functions - commented below
; 	Removed original Acc_Children function
;	Added Acc_Error, Acc_ChildrenByRole, &amp; Acc_Get functions
; last updated 10/25/2012
;------------------------------------------------------------------------------

Acc_Init()
{
	Static	h
	If Not	h
		h:=DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,&quot;oleacc&quot;,&quot;Ptr&quot;)
}
Acc_ObjectFromEvent(ByRef _idChild_, hWnd, idObject, idChild)
{
	Acc_Init()
	If	DllCall(&quot;oleacc\AccessibleObjectFromEvent&quot;, &quot;Ptr&quot;, hWnd, &quot;UInt&quot;, idObject, &quot;UInt&quot;, idChild, &quot;Ptr*&quot;, pacc, &quot;Ptr&quot;, VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&amp;varChild)=0
	Return	ComObjEnwrap(9,pacc,1), _idChild_:=NumGet(varChild,8,&quot;UInt&quot;)
}

Acc_ObjectFromPoint(ByRef _idChild_ = &quot;&quot;, x = &quot;&quot;, y = &quot;&quot;)
{
	Acc_Init()
	If	DllCall(&quot;oleacc\AccessibleObjectFromPoint&quot;, &quot;Int64&quot;, x==&quot;&quot;||y==&quot;&quot;?0*DllCall(&quot;GetCursorPos&quot;,&quot;Int64*&quot;,pt)+pt:x&amp;0xFFFFFFFF|y&lt;&lt;32, &quot;Ptr*&quot;, pacc, &quot;Ptr&quot;, VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&amp;varChild)=0
	Return	ComObjEnwrap(9,pacc,1), _idChild_:=NumGet(varChild,8,&quot;UInt&quot;)
}

Acc_ObjectFromWindow(hWnd, idObject = 0)
{
	Acc_Init()
	If	DllCall(&quot;oleacc\AccessibleObjectFromWindow&quot;, &quot;Ptr&quot;, hWnd, &quot;UInt&quot;, idObject&amp;=0xFFFFFFFF, &quot;Ptr&quot;, -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,&quot;Int64&quot;),&quot;Int64&quot;), &quot;Ptr*&quot;, pacc)=0
	Return	ComObjEnwrap(9,pacc,1)
}

Acc_WindowFromObject(pacc)
{
	If	DllCall(&quot;oleacc\WindowFromAccessibleObject&quot;, &quot;Ptr&quot;, IsObject(pacc)?ComObjValue(pacc):pacc, &quot;Ptr*&quot;, hWnd)=0
	Return	hWnd
}

Acc_GetRoleText(nRole)
{
	nSize := DllCall(&quot;oleacc\GetRoleText&quot;, &quot;Uint&quot;, nRole, &quot;Ptr&quot;, 0, &quot;Uint&quot;, 0)
	VarSetCapacity(sRole, (A_IsUnicode?2:1)*nSize)
	DllCall(&quot;oleacc\GetRoleText&quot;, &quot;Uint&quot;, nRole, &quot;str&quot;, sRole, &quot;Uint&quot;, nSize+1)
	Return	sRole
}

Acc_GetStateText(nState)
{
	nSize := DllCall(&quot;oleacc\GetStateText&quot;, &quot;Uint&quot;, nState, &quot;Ptr&quot;, 0, &quot;Uint&quot;, 0)
	VarSetCapacity(sState, (A_IsUnicode?2:1)*nSize)
	DllCall(&quot;oleacc\GetStateText&quot;, &quot;Uint&quot;, nState, &quot;str&quot;, sState, &quot;Uint&quot;, nSize+1)
	Return	sState
}

Acc_SetWinEventHook(eventMin, eventMax, pCallback)
{
	Return	DllCall(&quot;SetWinEventHook&quot;, &quot;Uint&quot;, eventMin, &quot;Uint&quot;, eventMax, &quot;Uint&quot;, 0, &quot;Ptr&quot;, pCallback, &quot;Uint&quot;, 0, &quot;Uint&quot;, 0, &quot;Uint&quot;, 0)
}

Acc_UnhookWinEvent(hHook)
{
	Return	DllCall(&quot;UnhookWinEvent&quot;, &quot;Ptr&quot;, hHook)
}
/*	Win Events:

	pCallback := RegisterCallback(&quot;WinEventProc&quot;)
	WinEventProc(hHook, event, hWnd, idObject, idChild, eventThread, eventTime)
	{
		Critical
		Acc := Acc_ObjectFromEvent(_idChild_, hWnd, idObject, idChild)
		; Code Here:

	}
*/

; Written by jethrow
Acc_Role(Acc, ChildId=0) {
	try return ComObjType(Acc,&quot;Name&quot;)=&quot;IAccessible&quot;?Acc_GetRoleText(Acc.accRole(ChildId)):&quot;invalid object&quot;
}
Acc_State(Acc, ChildId=0) {
	try return ComObjType(Acc,&quot;Name&quot;)=&quot;IAccessible&quot;?Acc_GetStateText(Acc.accState(ChildId)):&quot;invalid object&quot;
}
Acc_Location(Acc, ChildId=0, byref Position=&quot;&quot;) { ; adapted from Sean&#039;s code
	try Acc.accLocation(ComObj(0x4003,&amp;x:=0), ComObj(0x4003,&amp;y:=0), ComObj(0x4003,&amp;w:=0), ComObj(0x4003,&amp;h:=0), ChildId)
	catch
		return
	Position := &quot;x&quot; NumGet(x,0,&quot;int&quot;) &quot; y&quot; NumGet(y,0,&quot;int&quot;) &quot; w&quot; NumGet(w,0,&quot;int&quot;) &quot; h&quot; NumGet(h,0,&quot;int&quot;)
	return	{x:NumGet(x,0,&quot;int&quot;), y:NumGet(y,0,&quot;int&quot;), w:NumGet(w,0,&quot;int&quot;), h:NumGet(h,0,&quot;int&quot;)}
}
Acc_Parent(Acc) { 
	try parent:=Acc.accParent
	return parent?Acc_Query(parent):
}
Acc_Child(Acc, ChildId=0) {
	try child:=Acc.accChild(ChildId)
	return child?Acc_Query(child):
}
Acc_Query(Acc) { ; thanks Lexikos - www.autohotkey.com/forum/viewtopic.php?t=81731&amp;p=509530#509530
	try return ComObj(9, ComObjQuery(Acc,&quot;{618736e0-3c3d-11cf-810c-00aa00389b71}&quot;), 1)
}
Acc_Error(p=&quot;&quot;) {
	static setting:=0
	return p=&quot;&quot;?setting:setting:=p
}
Acc_Children(Acc) {
	if ComObjType(Acc,&quot;Name&quot;) != &quot;IAccessible&quot;
		ErrorLevel := &quot;Invalid IAccessible Object&quot;
	else {
		Acc_Init(), cChildren:=Acc.accChildCount, Children:=[]
		if DllCall(&quot;oleacc\AccessibleChildren&quot;, &quot;Ptr&quot;,ComObjValue(Acc), &quot;Int&quot;,0, &quot;Int&quot;,cChildren, &quot;Ptr&quot;,VarSetCapacity(varChildren,cChildren*(8+2*A_PtrSize),0)*0+&amp;varChildren, &quot;Int*&quot;,cChildren)=0 {
			Loop %cChildren%
				i:=(A_Index-1)*(A_PtrSize*2+8)+8, child:=NumGet(varChildren,i), Children.Insert(NumGet(varChildren,i-8)=9?Acc_Query(child):child), NumGet(varChildren,i-8)=9?ObjRelease(child):
			return Children.MaxIndex()?Children:
		} else
			ErrorLevel := &quot;AccessibleChildren DllCall Failed&quot;
	}
	if Acc_Error()
		throw Exception(ErrorLevel,-1)
}
Acc_ChildrenByRole(Acc, Role) {
	if ComObjType(Acc,&quot;Name&quot;)!=&quot;IAccessible&quot;
		ErrorLevel := &quot;Invalid IAccessible Object&quot;
	else {
		Acc_Init(), cChildren:=Acc.accChildCount, Children:=[]
		if DllCall(&quot;oleacc\AccessibleChildren&quot;, &quot;Ptr&quot;,ComObjValue(Acc), &quot;Int&quot;,0, &quot;Int&quot;,cChildren, &quot;Ptr&quot;,VarSetCapacity(varChildren,cChildren*(8+2*A_PtrSize),0)*0+&amp;varChildren, &quot;Int*&quot;,cChildren)=0 {
			Loop %cChildren% {
				i:=(A_Index-1)*(A_PtrSize*2+8)+8, child:=NumGet(varChildren,i)
				if NumGet(varChildren,i-8)=9
					AccChild:=Acc_Query(child), ObjRelease(child), Acc_Role(AccChild)=Role?Children.Insert(AccChild):
				else
					Acc_Role(Acc, child)=Role?Children.Insert(child):
			}
			return Children.MaxIndex()?Children:, ErrorLevel:=0
		} else
			ErrorLevel := &quot;AccessibleChildren DllCall Failed&quot;
	}
	if Acc_Error()
		throw Exception(ErrorLevel,-1)
}
Acc_Get(Cmd, ChildPath=&quot;&quot;, ChildID=0, WinTitle=&quot;&quot;, WinText=&quot;&quot;, ExcludeTitle=&quot;&quot;, ExcludeText=&quot;&quot;) {
	static properties := {Action:&quot;DefaultAction&quot;, DoAction:&quot;DoDefaultAction&quot;, Keyboard:&quot;KeyboardShortcut&quot;}
	AccObj :=   IsObject(WinTitle)? WinTitle
			:   Acc_ObjectFromWindow( WinExist(WinTitle, WinText, ExcludeTitle, ExcludeText), 0 )
	if ComObjType(AccObj, &quot;Name&quot;) != &quot;IAccessible&quot;
		ErrorLevel := &quot;Could not access an IAccessible Object&quot;
	else {
		StringReplace, ChildPath, ChildPath, _, %A_Space%, All
		AccError:=Acc_Error(), Acc_Error(true)
		Loop Parse, ChildPath, ., %A_Space%
			try {
				if A_LoopField is digit
					Children:=Acc_Children(AccObj), m2:=A_LoopField ; mimic &quot;m2&quot; output in else-statement
				else
					RegExMatch(A_LoopField, &quot;(\D*)(\d*)&quot;, m), Children:=Acc_ChildrenByRole(AccObj, m1), m2:=(m2?m2:1)
				if Not Children.HasKey(m2)
					throw
				AccObj := Children[m2]
			} catch {
				ErrorLevel:=&quot;Cannot access ChildPath Item #&quot; A_Index &quot; -&gt; &quot; A_LoopField, Acc_Error(AccError)
				if Acc_Error()
					throw Exception(&quot;Cannot access ChildPath Item&quot;, -1, &quot;Item #&quot; A_Index &quot; -&gt; &quot; A_LoopField)
				return
			}
		Acc_Error(AccError)
		StringReplace, Cmd, Cmd, %A_Space%, , All
		properties.HasKey(Cmd)? Cmd:=properties[Cmd]:
		try {
			if (Cmd = &quot;Location&quot;)
				AccObj.accLocation(ComObj(0x4003,&amp;x:=0), ComObj(0x4003,&amp;y:=0), ComObj(0x4003,&amp;w:=0), ComObj(0x4003,&amp;h:=0), ChildId)
			  , ret_val := &quot;x&quot; NumGet(x,0,&quot;int&quot;) &quot; y&quot; NumGet(y,0,&quot;int&quot;) &quot; w&quot; NumGet(w,0,&quot;int&quot;) &quot; h&quot; NumGet(h,0,&quot;int&quot;)
			else if (Cmd = &quot;Object&quot;)
				ret_val := AccObj
			else if Cmd in Role,State
				ret_val := Acc_%Cmd%(AccObj, ChildID+0)
			else if Cmd in ChildCount,Selection,Focus
				ret_val := AccObj[&quot;acc&quot; Cmd]
			else
				ret_val := AccObj[&quot;acc&quot; Cmd](ChildID+0)
		} catch {
			ErrorLevel := &quot;&quot;&quot;&quot; Cmd &quot;&quot;&quot; Cmd Not Implemented&quot;
			if Acc_Error()
				throw Exception(&quot;Cmd Not Implemented&quot;, -1, Cmd)
			return
		}
		return ret_val, ErrorLevel:=0
	}
	if Acc_Error()
		throw Exception(ErrorLevel,-1)
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-08-24T14:20:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107021#p107021</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107016#p107016" />
			<content type="html"><![CDATA[<p><strong>red2881</strong>, благодарю, но в первом посте я описал как раз этот момент:<br /></p><div class="quotebox"><cite>KusochekDobra пишет:</cite><blockquote><p>Добра всем.<br />Скриптом, запускаю браузер в несколько профилей, для работы с одним ресурсом...</p></blockquote></div><p><strong>Malcev</strong>, AHK ругается, что происходит вызов несуществующей &quot;Acc_ObjectFromWindow()&quot; функции. =/</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-08-24T12:34:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107016#p107016</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107012#p107012" />
			<content type="html"><![CDATA[<p>В хроме можно работать сразу с несколькими пользователями. Для каждого будут свой настройки.&nbsp; &nbsp;<a href="https://support.google.com/chrome/answer/2364824?hl=ru">https://support.google.com/chrome/answer/2364824?hl=ru</a><br /><span class="postimg"><img src="http://livelenta.com/wp-content/uploads/2015/02/rezhim-v-google-chrome_1.jpg" alt="http://livelenta.com/wp-content/uploads/2015/02/rezhim-v-google-chrome_1.jpg" /></span></p>]]></content>
			<author>
				<name><![CDATA[red2881]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30934</uri>
			</author>
			<updated>2016-08-24T07:02:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107012#p107012</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107011#p107011" />
			<content type="html"><![CDATA[<p>У хрома можно еще так получить:<br /></p><div class="codebox"><pre><code>SetBatchLines, -1
Window := &quot;ahk_class Chrome_WidgetWin_1&quot;
Role := 60  ; ROLE_SYSTEM_PAGETABLIST

AccObj := Acc_ObjectFromWindow(WinExist(Window))
; параметры, начиная со второго: Role, Name, Value
AccElem := SearchElement(AccObj, Role, &quot;&quot;, &quot;&quot;)
msgbox % AccElem.accChildCount - 1

SearchElement(ParentElement, params*)
{
   found := 1
   for k, v in params  {
      (k = 1 &amp;&amp; ParentElement.accRole(0) != v &amp;&amp; found := &quot;&quot;)
      (k = 2 &amp;&amp; ParentElement.accName(0) != v &amp;&amp; found := &quot;&quot;)
      (k = 3 &amp;&amp; ParentElement.accValue(0) != v &amp;&amp; found := &quot;&quot;)
   }
   if found
      Return ParentElement
   
   for k, v in Acc_Children(ParentElement)
      if obj := SearchElement(v, params*)
         Return obj
}</code></pre></div><p>У Яндекса, думаю, аналогично.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-08-24T06:32:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107011#p107011</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Получить хендлы всех вкладок браузера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=107009#p107009" />
			<content type="html"><![CDATA[<p>Добра всем.<br />Скриптом, запускаю браузер в несколько профилей, для работы с одним ресурсом. Стартовой страницей в настройках указано открывать всегда пустую страницу, а переход на адрес осуществляется передачей его параметром браузеру при запуске. Далее автологин на сайт, размещение окна на рабочем столе и т.д. Но иногда бывает так, что вместе с адресом полученным при старте, открывается страница с прошлой позицией на ресурсе и автологин коннектит обе страницы на ресурс, что чревато баном, или схожими с этим проблемами. Решил отслеживать эти моменты при запуске:<br /></p><div class="codebox"><pre><code>
SetTitleMatchMode, 2

ya := &quot;Yandex&quot;
cr := &quot;Chrome&quot;

WinGet, winVar, ID, %cr%
WinGet, ctrlVar, ControlListHwnd, ahk_id %winVar%

strSp := StrSplit(ctrlVar,&quot;`n&quot;)

MsgBox,, Title, % &quot;Main: &quot; winVar &quot;`n`nCount: &quot; strSp.Length() &quot;`n`nCtrlList:`n&quot; ctrlVar
</code></pre></div><p>В Хроме прекрасно работает развязывая руки для следующих манипуляций, а в Яндексе всегда показывает только один контрол активной вкладки. Вся соль в расширениях, которые можно установить в эти браузеры, но Яндекс ведёт себя более стабильно в работе, поэтому прошу поделиться мудростью, как бы так проделать похожий трюк и с ним. Результат всегда одинаков в обоих режимах Яндекс-браузера.</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-08-23T21:57:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=107009#p107009</id>
		</entry>
</feed>
