<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12616&amp;type=atom" />
	<updated>2017-04-15T16:33:05Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=12616</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115084#p115084" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, Спасибо!<br />Сложен для понимания, редактирования. Пока еще не следовал алгоритму, позже попробую.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-15T16:33:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115084#p115084</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115083#p115083" />
			<content type="html"><![CDATA[<p>Чем он сложен?<br />Повторить алгоритм действий, которые я написал? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />))</p><div class="quotebox"><blockquote><p>Укажите, пожалуйста, на ошибки в последнем моем примере</p></blockquote></div><p>Если у вас что-то не получается, то вы можете это тестировать сами:<br /></p><div class="codebox"><pre><code>a := b := 2
if (a = &quot;%b%&quot;)
   msgbox</code></pre></div><div class="codebox"><pre><code>a := b := 2
if (a = b)
   msgbox</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-15T15:44:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115083#p115083</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115082#p115082" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, Спасибо! Пожалуй, этот вариант для меня слишком сложен. Но я протестирую.</p><p>Укажите, пожалуйста, на ошибки в последнем моем примере. Сейчас скрипт увеличивает скорость вплоть до принудительного его закрытия, а не до момента совпадения с сохраненной скоростью ранее (<em>previousspeed</em>).</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-15T15:36:46Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115082#p115082</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115078#p115078" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>А реально отправить значение в виде текста в найденный элемент, наподобие ControlSetText?</p></blockquote></div><p>Можно только через веб-интерфейс.<br />В Main Interface ставите галочку на web.<br />Заходите в Lua, там в Lua Http Password вписываете 0000<br />Перезагружаете Vlc и запускаете следующий скрипт, который увеличит воспроизведение в 2 раза:<br /></p><div class="codebox"><pre><code>HttpRequest := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
url:= &quot;http://127.0.0.1:8080/requests/status.xml?command=rate&amp;val=2&quot;
HttpRequest.Open(&quot;GET&quot;, URL)
HttpRequest.SetRequestHeader(&quot;Authorization&quot;, &quot;Basic OjAwMDA=&quot;) ;&quot;:0000&quot; to Base64 &quot;OjAwMDA=&quot;
HttpRequest.Send()
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-15T14:28:46Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115078#p115078</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115071#p115071" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, вновь запутался, получилось.<br />А реально отправить значение в виде текста в найденный элемент, наподобие <em>ControlSetText</em>? Т.е. задать предустановленную скорость, например, <em>1.85x</em>. Мне нужно вернуть предыдущее значение сокрости, пытался реализовать методом сранения, но не работает. Скажите, пожалуйста, где ошибка?<br /></p><div class="codebox"><pre><code>
VideoPlayer := &quot;QWidget&quot;
+f1::
^+f1::
if (A_thIsHotkey = &quot;+f1&quot;){
	previousspeed := Acc_Get(&quot;Name&quot;,&quot;4.2.3&quot;,0, &quot;ahk_exe vlc.exe&quot;)
	ControlSend, , =, ahk_class %VideoPlayer% ; 1.00x
}
if (A_thIsHotkey = &quot;^+f1&quot;){
	speed := Acc_Get(&quot;Name&quot;,&quot;4.2.3&quot;,0, &quot;ahk_exe vlc.exe&quot;)
	while (speed != &quot;%previousspeed%&quot;){
		ControlSend, , {vkDD}, ahk_class %VideoPlayer% ; {]} (+0.10x)
		speed := Acc_Get(&quot;Name&quot;,&quot;4.2.3&quot;,0, &quot;ahk_exe vlc.exe&quot;)
		Sleep 50
}
}
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-15T10:42:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115071#p115071</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115068#p115068" />
			<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>2017-04-15T03:45:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115068#p115068</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115066#p115066" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, Спасибо!<br />А как задать условие, что скорость воспроизведения не только равна <em>2.00x</em>, но и более это значения, например, <em>3.55x</em>?</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-14T20:01:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115066#p115066</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115065#p115065" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Почему, не знаю.</p></blockquote></div><p>Потому что&nbsp; надо читать справку:<br /></p><div class="quotebox"><blockquote><p>Цифровые имена нельзя использовать в выражениях, поскольку там они будут восприниматься не как имена, а как числа.</p></blockquote></div><p><a href="http://www.script-coding.com/AutoHotkey/Variables.1.0.46.07.html">http://www.script-coding.com/AutoHotkey … 46.07.html</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-14T19:50:10Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115065#p115065</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115064#p115064" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, оказалось, что иу меня работает. А до это не работало с использованием переменной <em>111 </em>вместо <em>speed</em>. Почему, не знаю.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-14T19:27:00Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115064#p115064</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115062#p115062" />
			<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>2017-04-14T18:11:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115062#p115062</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115058#p115058" />
			<content type="html"><![CDATA[<p><strong>stealzy</strong>, вероятно, я неверно тестирую, но получаю пустое окно.<br /><strong>Malcev</strong>, спасибо! Окно выдает текущее значение скорости воспроизведения. Но задать условие у меня не получилось.<br /></p><div class="codebox"><pre><code>speed := Acc_Get(&quot;Name&quot;,&quot;4.2.3&quot;,0, &quot;ahk_exe vlc.exe&quot;)
if (speed = &quot;1.00x&quot;)
{
	msgbox, Normal speed
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-14T13:40:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115058#p115058</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115052#p115052" />
			<content type="html"><![CDATA[<p>У меня всё тоже самое, но показывает:<br /></p><div class="codebox"><pre><code>msgbox % Acc_Get(&quot;Name&quot;,&quot;4.2.3&quot;,0, &quot;ahk_exe vlc.exe&quot;)</code></pre></div><p>AccViewer Source.ahk<br /></p><div class="codebox"><pre><code>{
	WM_ACTIVATE := 0x06
	WM_KILLFOCUS := 0x08
	WM_LBUTTONDOWN := 0x201
	WM_LBUTTONUP := 0x202
	global	Border := new Outline, Stored:={}, Acc, ChildId, TVobj, Win:={}
}
{
	DetectHiddenWindows, On
	OnExit, OnExitCleanup
	OnMessage(0x200,&quot;WM_MOUSEMOVE&quot;)
	ComObjError(false)
	Hotkey, ~LButton Up, Off
}
{
	Gui Main: New, HWNDhwnd LabelGui AlwaysOnTop, Accessible Info Viewer
	Gui Main: Default
	Win.Main := hwnd
	Gui, Add, Button, x160 y8 w105 h20 vShowStructure gShowStructure, Show Acc Structure
	{
		Gui, Add, Text, x10 y3 w25 h26 Border gCrossHair ReadOnly HWNDh8 Border
		CColor(h8, &quot;White&quot;)
		Gui, Add, Text, x10 y3 w25 h4 HWNDh9 Border
		CColor(h9, &quot;0046D5&quot;)
		Gui, Add, Text, x13 y17 w19 h1 Border vHBar
		Gui, Add, Text, x22 y8 w1 h19 Border vVBar
	}
	{
		Gui, Font, bold
		Gui, Add, GroupBox, x2 y32 w275 h130 vWinCtrl, Window/Control Info
		Gui, Font
		Gui, Add, Text, x7 y49 w42 h20 Right, WinTitle:
		Gui, Add, Edit, x51 y47 w221 h20 vWinTitle ,
		Gui, Add, Text, x7 y71 w42 h20 Right, Text:
		Gui, Add, Edit, x51 y69 w221 h20 vText ,
		Gui, Add, Text, x7 y93 w42 h20 Right, Hwnd:
		Gui, Add, Edit, x51 y91 w72 h20 vHwnd,
		Gui, Add, Text, x126 y93 w51 h20 vClassText Right, Class(NN):
		Gui, Add, Edit, x178 y91 w94 h20 vClass,
		Gui, Add, Text, x7 y115 w42 h20 Right, Position:
		Gui, Add, Edit, x51 y113 w72 h20 vPosition,
		Gui, Add, Text, x126 y115 w51 h20 Right, Process:
		Gui, Add, Edit, x178 y113 w94 h20 vProcess,
		Gui, Add, Text, x7 y137 w42 h20 Right, Size:
		Gui, Add, Edit, x51 y135 w72 h20 vSize,
		Gui, Add, Text, x126 y137 w51 h20 Right, Proc ID:
		Gui, Add, Edit, x178 y135 w94 h20 vProcID,
	}
	{
		Gui, Font, bold
		Gui, Add, GroupBox, x2 y165 w275 h240 vAcc, Accessible Info
		Gui, Font
		Gui, Add, Text, x7 y182 w42 h20 Right, Name:
		Gui, Add, Edit, x51 y180 w221 h20 vAccName ,
		Gui, Add, Text, x7 y204 w42 h20 Right, Value:
		Gui, Add, Edit, x51 y202 w221 h20 vAccValue ,
		Gui, Add, Text, x7 y226 w42 h20 Right, Role:
		Gui, Add, Edit, x51 y224 w72 h20 vAccRole,
		Gui, Add, Text, x126 y226 w55 h20 Right, ChildCount:
		Gui, Add, Edit, x182 y224 w90 h20 vAccChildCount,
		Gui, Add, Text, x7 y248 w42 h20 Right, State:
		Gui, Add, Edit, x51 y246 w72 h20 vAccState,
		Gui, Add, Text, x126 y248 w55 h20 Right, Selection:
		Gui, Add, Edit, x182 y246 w90 h20 vAccSelection,
		Gui, Add, Text, x7 y270 w42 h20 Right, Action:
		Gui, Add, Edit, x51 y268 w72 h20 vAccAction,
		Gui, Add, Text, x126 y270 w55 h20 Right, Focus:
		Gui, Add, Edit, x182 y268 w90 h20 vAccFocus,
		{
			Gui, Add, Text, x7 y292 w55 h20 Right vAccLocationText, Location:
			Gui, Add, Edit, x65 y290 w207 h20 vAccLocation ,
			Gui, Add, Text, x7 y314 w55 h20 Right, Description:
			Gui, Add, Edit, x65 y312 w207 h20 vAccDescription ,
			Gui, Add, Text, x7 y336 w55 h20 Right, Keyboard:
			Gui, Add, Edit, x65 y334 w207 h20 vAccKeyboard ,
			Gui, Add, Text, x7 y358 w55 h20 Right, Help:
			Gui, Add, Edit, x65 y356 w207 h20 vAccHelp ,
			Gui, Add, Text, x7 y380 w55 h20 Right, HelpTopic:
			Gui, Add, Edit, x65 y378 w207 h20 vAccHelpTopic ,
		}
	}
	{
		Gui, Add, StatusBar, gShowMainGui
		SB_SetParts(70,150)
		SB_SetText(&quot;`tshow more&quot;, 3)
	}
	{
		Gui Acc: New, ToolWindow AlwaysOnTop Resize LabelAcc HWNDhwnd, Acc Structure
		Win.Acc := hwnd
		Gui Acc: Add, TreeView, w200 h300 vTView gTreeView R17 AltSubmit
		Gui Acc: Show, Hide
	}
	GoSub, ShowMainGui
	WinSet, Redraw, , % &quot;ahk_id&quot; Win.Main
	return
}
ShowMainGui:
{
	if A_EventInfo in 1,2
	{
		WM_MOUSEMOVE()
		StatusBarGetText, SB_Text, %A_EventInfo%, % &quot;ahk_id&quot; Win.Main
		if SB_Text
			if (A_EventInfo=2 and SB_Text:=SubStr(SB_Text,7))
			or if RegExMatch(SB_Text, &quot;Id: \K\d+&quot;, SB_Text) {
				ToolTip % &quot;clipboard = &quot; clipboard:=SB_Text
				SetTimer, RemoveToolTip, -2000
		}
	}
	else {
		Gui Main: Default
		if ShowingLess {
			SB_SetText(&quot;`tshow less&quot;, 3)
			GuiControl, Move, Acc, x2 y165 w275 h240
			GuiControl, Show, AccDescription
			GuiControl, Show, AccLocation
			GuiControl, Show, AccLocationText
			{
				height := 319
				while height&lt;428 {
					height += 10
					Gui, Show, w280 h%height%
					Sleep, 20
				}
			}
			Gui, Show, w280 h428
			ShowingLess := false
		}
		else {
			if (ShowingLess != &quot;&quot;) {
				height := 428
				while height&gt;319 {
					height -= 10
					Gui, Show, w280 h%height%
					Sleep, 20
				}
			}
			Gui, Show, w280 h319
			GuiControl, Hide, AccDescription
			GuiControl, Hide, AccLocation
			GuiControl, Hide, AccLocationText
			GuiControl, Move, Acc, x2 y165 w275 h130
			SB_SetText(&quot;`tshow more&quot;, 3)
			ShowingLess := true
		}
		WinSet, Redraw, , % &quot;ahk_id&quot; Win.Main
	}
return
}

#if Not Lbutton_Pressed
^/::
{
	SetBatchLines, -1
	Lbutton_Pressed := true
	Stored.Chwnd := &quot;&quot;
	Gui Acc: Default
	GuiControl, Disable, TView
	while, Lbutton_Pressed
	GetAccInfo()
	SetBatchLines, 10ms
	return
}
#if Lbutton_Pressed
^/::
{
	Lbutton_Pressed := false
	Gui Main: Default
	Sleep, -1
	GuiControl, , WinCtrl, % (DllCall(&quot;GetParent&quot;, Uint,Acc_WindowFromObject(Acc))? &quot;Control&quot;:&quot;Window&quot;) &quot; Info&quot;
	if Not DllCall(&quot;IsWindowVisible&quot;, &quot;Ptr&quot;,Win.Acc) {
		Border.Hide()
		SB_SetText(&quot;Path: &quot; GetAccPath(Acc).path, 2)
	}
	else {
		Gui Acc: Default
		BuildTreeView()
		GuiControl, Enable, TView
		WinActivate, % &quot;ahk_id&quot; Win.Acc
		PostMessage, %WM_LBUTTONDOWN%, , , SysTreeView321, % &quot;ahk_id&quot; Win.Acc
	}
	return
}
#if
~Lbutton Up::
{
	Hotkey, ~LButton Up, Off
	Lbutton_Pressed := False
	Gui Main: Default
	if Not CH {
		GuiControl, Show, HBar
		GuiControl, Show, VBar
		CrossHair(CH:=true)
	}
	Sleep, -1
	GuiControl, , WinCtrl, % (DllCall(&quot;GetParent&quot;, Uint,Acc_WindowFromObject(Acc))? &quot;Control&quot;:&quot;Window&quot;) &quot; Info&quot;
	if Not DllCall(&quot;IsWindowVisible&quot;, &quot;Ptr&quot;,Win.Acc) {
		Border.Hide()
		SB_SetText(&quot;Path: &quot; GetAccPath(Acc).path, 2)
	}
	else {
		Gui Acc: Default
		BuildTreeView()
		GuiControl, Enable, TView
		WinActivate, % &quot;ahk_id&quot; Win.Acc
		PostMessage, %WM_LBUTTONDOWN%, , , SysTreeView321, % &quot;ahk_id&quot; Win.Acc
	}
	return
}
CrossHair:
{
	if (A_GuiEvent = &quot;Normal&quot;) {
		SetBatchLines, -1
		Hotkey, ~LButton Up, On
		{
			GuiControl, Hide, HBar
			GuiControl, Hide, VBar
			CrossHair(CH:=false)
		}
		Lbutton_Pressed := True
		Stored.Chwnd := &quot;&quot;
		Gui Acc: Default
		GuiControl, Disable, TView
		while, Lbutton_Pressed
			GetAccInfo()
		SetBatchLines, 10ms
	}
	return
}
OnExitCleanup:
{
	CrossHair(true)
	GuiClose:
	ExitApp
}
ShowStructure:
{
	ControlFocus, Static1, % &quot;ahk_id&quot; Win.Main
	if DllCall(&quot;IsWindowVisible&quot;, &quot;Ptr&quot;,Win.Acc) {
		PostMessage, %WM_LBUTTONDOWN%, , , SysTreeView321, % &quot;ahk_id&quot; Win.Acc
		return
	}
	WinGetPos, x, y, w, , % &quot;ahk_id&quot; Win.Main
	WinGetPos, , , AccW, AccH, % &quot;ahk_id&quot; Win.Acc
	WinMove, % &quot;ahk_id&quot; Win.Acc,
		, (x+w+AccW &gt; A_ScreenWidth? x-AccW-10:x+w+10)
		, % y+5, %AccW%, %AccH%
	WinShow, % &quot;ahk_id&quot; Win.Acc
	if ComObjType(Acc, &quot;Name&quot;) = &quot;IAccessible&quot;
		BuildTreeView()
	if Lbutton_Pressed
		GuiControl, Disable, TView
	else
		GuiControl, Enable, TView
	PostMessage, %WM_LBUTTONDOWN%, , , SysTreeView321, % &quot;ahk_id&quot; Win.Acc
	return
}
BuildTreeView()
{
	r := GetAccPath(Acc)
	AccObj:=r.AccObj, Child_Path:=r.Path, r:=&quot;&quot;
	Gui Acc: Default
	TV_Delete()
	GuiControl, -Redraw, TView
	parent := TV_Add(Acc_Role(AccObj), &quot;&quot;, &quot;Bold Expand&quot;)
	TVobj := {(parent): {is_obj:true, obj:AccObj, need_children:false, childid:0, Children:[]}}
	Loop Parse, Child_Path, .
	{
		if A_LoopField is not Digit
			TVobj[parent].Obj_Path := Trim(TVobj[parent].Obj_Path &quot;,&quot; A_LoopField, &quot;,&quot;)
		else {
			StoreParent := parent
			parent := TV_BuildAccChildren(AccObj, parent, &quot;&quot;, A_LoopField)
			TVobj[parent].need_children := false
			TV_Expanded(StoreParent)
			TV_Modify(parent,&quot;Expand&quot;)
			AccObj := TVobj[parent].obj
		}
	}
	if Not ChildId {
		TV_BuildAccChildren(AccObj, parent)
		TV_Modify(parent, &quot;Select&quot;)
	}
	else
		TV_BuildAccChildren(AccObj, parent, ChildId)
	TV_Expanded(parent)
	GuiControl, +Redraw, TView
}
AccClose:
{
	Border.Hide()
	Gui Acc: Hide
	TV_Delete()
	Gui Main: Default
	GuiControl, Enable, ShowStructure
	return
}
AccSize:
{
	Anchor(TView, &quot;wh&quot;)
	return
}
TreeView:
{
	Gui, Submit, NoHide
	if (A_GuiEvent = &quot;S&quot;)
		UpdateAccInfo(TVobj[A_EventInfo].obj, TVobj[A_EventInfo].childid, TVobj[A_EventInfo].obj_path)
	if (A_GuiEvent = &quot;+&quot;) {
		GuiControl, -Redraw, TView
		TV_Expanded(A_EventInfo)
		GuiControl, +Redraw, TView
	}
	return
}
RemoveToolTip:
{
	ToolTip
	return
}
GetAccInfo() {
	global Whwnd
	static ShowButtonEnabled
	MouseGetPos, , , Whwnd
	if (Whwnd!=Win.Main and Whwnd!=Win.Acc) {
		{
			GuiControlGet, SectionLabel, , WinCtrl
			if (SectionLabel != &quot;Window/Control Info&quot;)
				GuiControl, , WinCtrl, Window/Control Info
		}
		Acc := Acc_ObjectFromPoint(ChildId)
		Location := GetAccLocation(Acc, ChildId)
		if Stored.Location != Location {
			Hwnd := Acc_WindowFromObject(Acc)
			if Stored.Hwnd != Hwnd {
				if DllCall(&quot;GetParent&quot;, Uint,hwnd) {
					WinGetTitle, title, ahk_id %parent%
					ControlGetText, text, , ahk_id %Hwnd%
					class := GetClassNN(Hwnd,Whwnd)
					ControlGetPos, posX, posY, posW, posH, , ahk_id %Hwnd%
					WinGet, proc, ProcessName, ahk_id %parent%
					WinGet, procid, PID, ahk_id %parent%
				}
				else {
					WinGetTitle, title, ahk_id %Hwnd%
					WinGetText, text, ahk_id %Hwnd%
					WinGetClass, class, ahk_id %Hwnd%
					WinGetPos, posX, posY, posW, posH, ahk_id %Hwnd%
					WinGet, proc, ProcessName, ahk_id %Hwnd%
					WinGet, procid, PID, ahk_id %Hwnd%
				}
				{
					GuiControl, , WinTitle, %title%
					GuiControl, , Text, %text%
					SetFormat, IntegerFast, H
					GuiControl, , Hwnd, % Hwnd+0
					SetFormat, IntegerFast, D
					GuiControl, , Class, %class%
					GuiControl, , Position, x%posX%  y%posY%
					GuiControl, , Size, w%posW%  h%posH%
					GuiControl, , Process, %proc%
					GuiControl, , ProcId, %procid%
				}
				Stored.Hwnd := Hwnd
			}
			UpdateAccInfo(Acc, ChildId)
		}
	}
}
UpdateAccInfo(Acc, ChildId, Obj_Path=&quot;&quot;) {
	global Whwnd
	Gui Main: Default
	Location := GetAccLocation(Acc, ChildId, x,y,w,h)
	{
		GuiControl, , AccName, % Acc.accName(ChildId)
		GuiControl, , AccValue, % Acc.accValue(ChildId)
		GuiControl, , AccRole, % Acc_GetRoleText(Acc.accRole(ChildId))
		GuiControl, , AccState, % Acc_GetStateText(Acc.accState(ChildId))
		GuiControl, , AccAction, % Acc.accDefaultAction(ChildId)
		GuiControl, , AccChildCount, % ChildId? &quot;N/A&quot;:Acc.accChildCount
		GuiControl, , AccSelection, % ChildId? &quot;N/A&quot;:Acc.accSelection
		GuiControl, , AccFocus, % ChildId? &quot;N/A&quot;:Acc.accFocus
		GuiControl, , AccLocation, %Location%
		GuiControl, , AccDescription, % Acc.accDescription(ChildId)
		GuiControl, , AccKeyboard, % Acc.accKeyboardShortCut(ChildId)
		Guicontrol, , AccHelp, % Acc.accHelp(ChildId)
		GuiControl, , AccHelpTopic, % Acc.accHelpTopic(ChildId)
		SB_SetText(ChildId? &quot;Child Id: &quot; ChildId:&quot;Object&quot;)
		SB_SetText(DllCall(&quot;IsWindowVisible&quot;, &quot;Ptr&quot;,Win.Acc)? &quot;Path: &quot; Obj_Path:&quot;&quot;, 2)
	}
	Border.Transparent(true)
	Border.show(x,y,x+w,y+h)
	Border.setabove(Whwnd)
	Border.Transparent(false)
	Stored.Location := Location
}
GetClassNN(Chwnd, Whwnd) {
	global _GetClassNN := {}
	_GetClassNN.Hwnd := Chwnd
	Detect := A_DetectHiddenWindows
	WinGetClass, Class, ahk_id %Chwnd%
	_GetClassNN.Class := Class
	DetectHiddenWindows, On
	EnumAddress := RegisterCallback(&quot;GetClassNN_EnumChildProc&quot;)
	DllCall(&quot;EnumChildWindows&quot;, &quot;uint&quot;,Whwnd, &quot;uint&quot;,EnumAddress)
	DetectHiddenWindows, %Detect%
	return, _GetClassNN.ClassNN, _GetClassNN:=&quot;&quot;
}
GetClassNN_EnumChildProc(hwnd, lparam) {
	static Occurrence
	global _GetClassNN
	WinGetClass, Class, ahk_id %hwnd%
	if _GetClassNN.Class == Class
		Occurrence++
	if Not _GetClassNN.Hwnd == hwnd
		return true
	else {
		_GetClassNN.ClassNN := _GetClassNN.Class Occurrence
		Occurrence := 0
		return false
	}
}
TV_Expanded(TVid) {
	For Each, TV_Child_ID in TVobj[TVid].Children
		if TVobj[TV_Child_ID].need_children
			TV_BuildAccChildren(TVobj[TV_Child_ID].obj, TV_Child_ID)
}
TV_BuildAccChildren(AccObj, Parent, Selected_Child=&quot;&quot;, Flag=&quot;&quot;) {
	TVobj[Parent].need_children := false
	Parent_Obj_Path := Trim(TVobj[Parent].Obj_Path, &quot;,&quot;)
	for wach, child in Acc_Children(AccObj) {
		if Not IsObject(child) {
			added := TV_Add(&quot;[&quot; A_Index &quot;] &quot; Acc_GetRoleText(AccObj.accRole(child)), Parent)
			TVobj[added] := {is_obj:false, obj:Acc, childid:child, Obj_Path:Parent_Obj_Path}
			if (child = Selected_Child)
				TV_Modify(added, &quot;Select&quot;)
		}
		else {
			added := TV_Add(&quot;[&quot; A_Index &quot;] &quot; Acc_Role(child), Parent, &quot;bold&quot;)
			TVobj[added] := {is_obj:true, need_children:true, obj:child, childid:0, Children:[], Obj_Path:Trim(Parent_Obj_Path &quot;,&quot; A_Index, &quot;,&quot;)}
		}
		TVobj[Parent].Children.Insert(added)
		if (A_Index = Flag)
			Flagged_Child := added
	}
	return Flagged_Child
}
GetAccPath(Acc, byref hwnd=&quot;&quot;) {
	hwnd := Acc_WindowFromObject(Acc)
	WinObj := Acc_ObjectFromWindow(hwnd)
	WinObjPos := Acc_Location(WinObj).pos
	while Acc_WindowFromObject(Parent:=Acc_Parent(Acc)) = hwnd {
		t2 := GetEnumIndex(Acc) &quot;.&quot; t2
		if Acc_Location(Parent).pos = WinObjPos
			return {AccObj:Parent, Path:SubStr(t2,1,-1)}
		Acc := Parent
	}
	while Acc_WindowFromObject(Parent:=Acc_Parent(WinObj)) = hwnd
		t1.=&quot;P.&quot;, WinObj:=Parent
	return {AccObj:Acc, Path:t1 SubStr(t2,1,-1)}
}
GetEnumIndex(Acc, ChildId=0) {
	if Not ChildId {
		ChildPos := Acc_Location(Acc).pos
		For Each, child in Acc_Children(Acc_Parent(Acc))
			if IsObject(child) and Acc_Location(child).pos=ChildPos
				return A_Index
	} 
	else {
		ChildPos := Acc_Location(Acc,ChildId).pos
		For Each, child in Acc_Children(Acc)
			if Not IsObject(child) and Acc_Location(Acc,child).pos=ChildPos
				return A_Index
	}
}
GetAccLocation(AccObj, Child=0, byref x=&quot;&quot;, byref y=&quot;&quot;, byref w=&quot;&quot;, byref h=&quot;&quot;) {
	AccObj.accLocation(ComObj(0x4003,&amp;x:=0), ComObj(0x4003,&amp;y:=0), ComObj(0x4003,&amp;w:=0), ComObj(0x4003,&amp;h:=0), Child)
	return	&quot;x&quot; (x:=NumGet(x,0,&quot;int&quot;)) &quot;  &quot;
	.	&quot;y&quot; (y:=NumGet(y,0,&quot;int&quot;)) &quot;  &quot;
	.	&quot;w&quot; (w:=NumGet(w,0,&quot;int&quot;)) &quot;  &quot;
	.	&quot;h&quot; (h:=NumGet(h,0,&quot;int&quot;))
}
WM_MOUSEMOVE() {
	static hCurs := new Cursor(32649)
	MouseGetPos,,,,ctrl
	if (ctrl = &quot;msctls_statusbar321&quot;)
		DllCall(&quot;SetCursor&quot;,&quot;ptr&quot;,hCurs.ptr)
}
class Cursor {
	__New(id) {
	this.ptr := DllCall(&quot;LoadCursor&quot;,&quot;UInt&quot;,NULL,&quot;Int&quot;,id,&quot;UInt&quot;)
}
__delete() {
DllCall(&quot;DestroyCursor&quot;,&quot;Uint&quot;,this.ptr)
}
}
class Outline {
	__New(color=&quot;red&quot;) {
		Gui, +HWNDdefault
		Loop, 4 {
			Gui, New, -Caption +ToolWindow HWNDhwnd
			Gui, Color, %color%
			this[A_Index] := hwnd
		}
		this.visible := false
		this.color := color
		this.top := this[1]
		this.right := this[2]
		this.bottom := this[3]
		this.left := this[4]
		Gui, %default%: Default
	}
	Show(x1, y1, x2, y2, sides=&quot;TRBL&quot;) {
		Gui, +HWNDdefault
		if InStr( sides, &quot;T&quot; )
			Gui, % this[1] &quot;:Show&quot;, % &quot;NA X&quot; x1-2 &quot; Y&quot; y1-2 &quot; W&quot; x2-x1+4 &quot; H&quot; 2
		Else, Gui, % this[1] &quot;:Hide&quot;
		if InStr( sides, &quot;R&quot; )
			Gui, % this[2] &quot;:Show&quot;, % &quot;NA X&quot; x2 &quot; Y&quot; y1 &quot; W&quot; 2 &quot; H&quot; y2-y1
		Else, Gui, % this[2] &quot;:Hide&quot;
		if InStr( sides, &quot;B&quot; )
			Gui, % this[3] &quot;:Show&quot;, % &quot;NA X&quot; x1-2 &quot; Y&quot; y2 &quot; W&quot; x2-x1+4 &quot; H&quot; 2
		Else, Gui, % this[3] &quot;:Hide&quot;
		if InStr( sides, &quot;L&quot; )
			Gui, % this[4] &quot;:Show&quot;, % &quot;NA X&quot; x1-2 &quot; Y&quot; y1 &quot; W&quot; 2 &quot; H&quot; y2-y1
		Else, Gui, % this[3] &quot;:Hide&quot;
		self.visible := true
		Gui, %default%: Default
	}
	Hide() {
		Gui, +HWNDdefault
		Loop, 4
			Gui, % this[A_Index] &quot;: Hide&quot;
		self.visible := false
		Gui, %default%: Default
	}
	SetAbove(hwnd) {
		ABOVE := DllCall(&quot;GetWindow&quot;, &quot;uint&quot;, hwnd, &quot;uint&quot;, 3)
		Loop, 4
			DllCall(	&quot;SetWindowPos&quot;, &quot;uint&quot;, this[A_Index], &quot;uint&quot;, ABOVE
					,	&quot;int&quot;, 0, &quot;int&quot;, 0, &quot;int&quot;, 0, &quot;int&quot;, 0
					,	&quot;uint&quot;, 0x1|0x2|0x10	)
	}
	Transparent(param) {
		Loop, 4
			WinSet, Transparent, % param=1? 0:255, % &quot;ahk_id&quot; this[A_Index]
		self.visible := !param
	}
	Color(color) {
		Gui, +HWNDdefault
		Loop, 4
			Gui, % this[A_Index] &quot;: Color&quot; , %color%
		self.color := color
		Gui, %default%: Default
	}
	Destroy() {
		Loop, 4
			Gui, % this[A_Index] &quot;: Destroy&quot;
	}
}
CColor(Hwnd, Background=&quot;&quot;, Foreground=&quot;&quot;) {
	return CColor_(Background, Foreground, &quot;&quot;, Hwnd+0)
}
CColor_(Wp, Lp, Msg, Hwnd) {
	static
	static WM_CTLCOLOREDIT=0x0133, WM_CTLCOLORLISTBOX=0x134, WM_CTLCOLORSTATIC=0x0138
	,LVM_SETBKCOLOR=0x1001, LVM_SETTEXTCOLOR=0x1024, LVM_SETTEXTBKCOLOR=0x1026, TVM_SETTEXTCOLOR=0x111E, TVM_SETBKCOLOR=0x111D
	,BS_CHECKBOX=2, BS_RADIOBUTTON=8, ES_READONLY=0x800
	,CLR_NONE=-1, CSILVER=0xC0C0C0, CGRAY=0x808080, CWHITE=0xFFFFFF, CMAROON=0x80, CRED=0x0FF, CPURPLE=0x800080, CFUCHSIA=0xFF00FF,CGREEN=0x8000, CLIME=0xFF00, COLIVE=0x8080, CYELLOW=0xFFFF, CNAVY=0x800000, CBLUE=0xFF0000, CTEAL=0x808000, CAQUA=0xFFFF00
	,CLASSES := &quot;Button,ComboBox,Edit,ListBox,Static,RICHEDIT50W,SysListView32,SysTreeView32&quot;
	If (Msg = &quot;&quot;) {
		if !adrSetTextColor
		adrSetTextColor   := DllCall(&quot;GetProcAddress&quot;, &quot;uint&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;str&quot;, &quot;Gdi32.dll&quot;), &quot;str&quot;, &quot;SetTextColor&quot;)
		,adrSetBkColor   := DllCall(&quot;GetProcAddress&quot;, &quot;uint&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;str&quot;, &quot;Gdi32.dll&quot;), &quot;str&quot;, &quot;SetBkColor&quot;)
		,adrSetBkMode   := DllCall(&quot;GetProcAddress&quot;, &quot;uint&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;str&quot;, &quot;Gdi32.dll&quot;), &quot;str&quot;, &quot;SetBkMode&quot;)
		BG := !Wp ? &quot;&quot; : C%Wp% != &quot;&quot; ? C%Wp% : &quot;0x&quot; SubStr(WP,5,2) SubStr(WP,3,2) SubStr(WP,1,2)
		FG := !Lp ? &quot;&quot; : C%Lp% != &quot;&quot; ? C%Lp% : &quot;0x&quot; SubStr(LP,5,2) SubStr(LP,3,2) SubStr(LP,1,2)
		WinGetClass, class, ahk_id %Hwnd%
		If class not in %CLASSES%
			return A_ThisFunc &quot;&gt; Unsupported control class: &quot; class
		ControlGet, style, Style, , , ahk_id %Hwnd%
		if (class = &quot;Edit&quot;) &amp;&amp; (Style &amp; ES_READONLY)
			class := &quot;Static&quot;
		if (class = &quot;Button&quot;)
			if (style &amp; BS_RADIOBUTTON) || (style &amp; BS_CHECKBOX)
				class := &quot;Static&quot;
			else 
				return A_ThisFunc &quot;&gt; Unsupported control class: &quot; class
		if (class = &quot;ComboBox&quot;) {
			VarSetCapacity(CBBINFO, 52, 0), NumPut(52, CBBINFO), DllCall(&quot;GetComboBoxInfo&quot;, &quot;UInt&quot;, Hwnd, &quot;UInt&quot;, &amp;CBBINFO)
			hwnd := NumGet(CBBINFO, 48)
			%hwnd%BG := BG, %hwnd%FG := FG, %hwnd% := BG ? DllCall(&quot;CreateSolidBrush&quot;, &quot;UInt&quot;, BG) : -1
			IfEqual, CTLCOLORLISTBOX,,SetEnv, CTLCOLORLISTBOX, % OnMessage(WM_CTLCOLORLISTBOX, A_ThisFunc)
			If NumGet(CBBINFO,44)
				Hwnd :=  Numget(CBBINFO,44), class := &quot;Edit&quot;
		}
		if class in SysListView32,SysTreeView32
		{
			m := class=&quot;SysListView32&quot; ? &quot;LVM&quot; : &quot;TVM&quot;
			SendMessage, %m%_SETBKCOLOR, ,BG, ,ahk_id %Hwnd%
			SendMessage, %m%_SETTEXTCOLOR, ,FG, ,ahk_id %Hwnd%
			SendMessage, %m%_SETTEXTBKCOLOR, ,CLR_NONE, ,ahk_id %Hwnd%
			return
		}
		if (class = &quot;RICHEDIT50W&quot;)
			return f := &quot;RichEdit_SetBgColor&quot;, %f%(Hwnd, -BG)
		if (!CTLCOLOR%Class%)
			CTLCOLOR%Class% := OnMessage(WM_CTLCOLOR%Class%, A_ThisFunc)
		return %Hwnd% := BG ? DllCall(&quot;CreateSolidBrush&quot;, &quot;UInt&quot;, BG) : CLR_NONE,  %Hwnd%BG := BG,  %Hwnd%FG := FG
	}
	critical
	Hwnd := Lp + 0, hDC := Wp + 0
	If (%Hwnd%) {
		DllCall(adrSetBkMode, &quot;uint&quot;, hDC, &quot;int&quot;, 1)
		if (%Hwnd%FG)
			DllCall(adrSetTextColor, &quot;UInt&quot;, hDC, &quot;UInt&quot;, %Hwnd%FG)
		if (%Hwnd%BG)
			DllCall(adrSetBkColor, &quot;UInt&quot;, hDC, &quot;UInt&quot;, %Hwnd%BG)
		return (%Hwnd%)
	}
}
CrossHair(OnOff=1) {
	static AndMask, XorMask, $, h_cursor, IDC_CROSS := 32515
	,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13
	, b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13
	, h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13
	if (OnOff = &quot;Init&quot; or OnOff = &quot;I&quot; or $ = &quot;&quot;) {
		$ := &quot;h&quot;
		, VarSetCapacity( h_cursor,4444, 1 )
		, VarSetCapacity( AndMask, 32*4, 0xFF )
		, VarSetCapacity( XorMask, 32*4, 0 )
		, system_cursors := &quot;32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650&quot;
		StringSplit c, system_cursors, `,
		Loop, %c0%
			h_cursor   := DllCall( &quot;LoadCursor&quot;, &quot;uint&quot;,0, &quot;uint&quot;,c%A_Index% )
			, h%A_Index% := DllCall( &quot;CopyImage&quot;,  &quot;uint&quot;,h_cursor, &quot;uint&quot;,2, &quot;int&quot;,0, &quot;int&quot;,0, &quot;uint&quot;,0 )
			, b%A_Index% := DllCall(&quot;LoadCursor&quot;, &quot;Uint&quot;, &quot;&quot;, &quot;Int&quot;, IDC_CROSS, &quot;Uint&quot;)
	}
	$ := (OnOff = 0 || OnOff = &quot;Off&quot; || $ = &quot;h&quot; &amp;&amp; (OnOff &lt; 0 || OnOff = &quot;Toggle&quot; || OnOff = &quot;T&quot;)) ? &quot;b&quot; : &quot;h&quot;
	Loop, %c0%
		h_cursor := DllCall( &quot;CopyImage&quot;, &quot;uint&quot;,%$%%A_Index%, &quot;uint&quot;,2, &quot;int&quot;,0, &quot;int&quot;,0, &quot;uint&quot;,0 )
		, DllCall( &quot;SetSystemCursor&quot;, &quot;uint&quot;,h_cursor, &quot;uint&quot;,c%A_Index% )
}

{ ; Acc Library
	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_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_Children(Acc) {
	if ComObjType(Acc,&quot;Name&quot;)!=&quot;IAccessible&quot;
	error_message := &quot;Cause:`tInvalid IAccessible Object`n`n&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)=3?child:Acc_Query(child)), ObjRelease(child)
	return Children
	}
	}
	error:=Exception(&quot;&quot;,-1)
	MsgBox, 262148, Acc_Children Failed, % (error_message?error_message:&quot;&quot;) &quot;File:`t&quot; (error.file==A_ScriptFullPath?A_ScriptName:error.file) &quot;`nLine:`t&quot; error.line &quot;`n`nContinue Script?&quot;
	IfMsgBox, No
	ExitApp
	}
	Acc_Location(Acc, ChildId=0) {
	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
	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;)
	,	pos:&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;)}
	}
	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) {
	try return ComObj(9, ComObjQuery(Acc,&quot;{618736e0-3c3d-11cf-810c-00aa00389b71}&quot;), 1)
	}
}

Anchor(i, a = &quot;&quot;, r = false) {
	static c, cs = 12, cx = 255, cl = 0, g, gs = 8, gl = 0, gpi, gw, gh, z = 0, k = 0xffff, ptr
	If z = 0
		VarSetCapacity(g, gs * 99, 0), VarSetCapacity(c, cs * cx, 0), ptr := A_PtrSize ? &quot;Ptr&quot; : &quot;UInt&quot;, z := true
	If (!WinExist(&quot;ahk_id&quot; . i)) {
		GuiControlGet, t, Hwnd, %i%
		If ErrorLevel = 0
		i := t
		Else ControlGet, i, Hwnd, , %i%
	}
	VarSetCapacity(gi, 68, 0), DllCall(&quot;GetWindowInfo&quot;, &quot;UInt&quot;, gp := DllCall(&quot;GetParent&quot;, &quot;UInt&quot;, i), ptr, &amp;gi)
	, giw := NumGet(gi, 28, &quot;Int&quot;) - NumGet(gi, 20, &quot;Int&quot;), gih := NumGet(gi, 32, &quot;Int&quot;) - NumGet(gi, 24, &quot;Int&quot;)
	If (gp != gpi) {
		gpi := gp
		Loop, %gl%
			If (NumGet(g, cb := gs * (A_Index - 1)) == gp, &quot;UInt&quot;) {
				gw := NumGet(g, cb + 4, &quot;Short&quot;), gh := NumGet(g, cb + 6, &quot;Short&quot;), gf := 1
				Break
			}
		If (!gf)
			NumPut(gp, g, gl, &quot;UInt&quot;), NumPut(gw := giw, g, gl + 4, &quot;Short&quot;), NumPut(gh := gih, g, gl + 6, &quot;Short&quot;), gl += gs
	}
	ControlGetPos, dx, dy, dw, dh, , ahk_id %i%
	Loop, %cl%
	If (NumGet(c, cb := cs * (A_Index - 1), &quot;UInt&quot;) == i) {
		If a =
		{
			cf = 1
			Break
		}
		giw -= gw, gih -= gh, as := 1, dx := NumGet(c, cb + 4, &quot;Short&quot;), dy := NumGet(c, cb + 6, &quot;Short&quot;)
		, cw := dw, dw := NumGet(c, cb + 8, &quot;Short&quot;), ch := dh, dh := NumGet(c, cb + 10, &quot;Short&quot;)
		Loop, Parse, a, xywh
			If A_Index &gt; 1
				av := SubStr(a, as, 1), as += 1 + StrLen(A_LoopField)
				, d%av% += (InStr(&quot;yh&quot;, av) ? gih : giw) * (A_LoopField + 0 ? A_LoopField : 1)
		DllCall(&quot;SetWindowPos&quot;, &quot;UInt&quot;, i, &quot;UInt&quot;, 0, &quot;Int&quot;, dx, &quot;Int&quot;, dy
		, &quot;Int&quot;, InStr(a, &quot;w&quot;) ? dw : cw, &quot;Int&quot;, InStr(a, &quot;h&quot;) ? dh : ch, &quot;Int&quot;, 4)
		If r != 0
			DllCall(&quot;RedrawWindow&quot;, &quot;UInt&quot;, i, &quot;UInt&quot;, 0, &quot;UInt&quot;, 0, &quot;UInt&quot;, 0x0101)
		Return
	}
	If cf != 1
		cb := cl, cl += cs
	bx := NumGet(gi, 48, &quot;UInt&quot;), by := NumGet(gi, 16, &quot;Int&quot;) - NumGet(gi, 8, &quot;Int&quot;) - gih - NumGet(gi, 52, &quot;UInt&quot;)
	If cf = 1
		dw -= giw - gw, dh -= gih - gh
	NumPut(i, c, cb, &quot;UInt&quot;), NumPut(dx - bx, c, cb + 4, &quot;Short&quot;), NumPut(dy - by, c, cb + 6, &quot;Short&quot;)
	, NumPut(dw, c, cb + 8, &quot;Short&quot;), NumPut(dh, c, cb + 10, &quot;Short&quot;)
	Return, true
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-13T20:48:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115052#p115052</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115051#p115051" />
			<content type="html"><![CDATA[<p>Вообще acc свойство можно прочитать, зная его acc путь, который по кнопке Show Acc Structure:<br />Только, насколько помню, в Acc Info Viewer путь толи смещен на единицу, толи верхней &quot;директории&quot; не хватает.<br /></p><div class="codebox"><pre><code>#SingleInstance force
; sClass := &quot;ApplicationFrameWindow&quot;, AccPath := &quot;4.2.4.10&quot;, Item := &quot;Name&quot;
; sClass := &quot;Chrome_WidgetWin_1&quot;, AccPath := &quot;4.1.2.1.1.5.1.3&quot;, Item := &quot;Value&quot;
sClass := &quot;MozillaWindowClass&quot;, AccPath := &quot;4.55.8.2&quot;, Item := &quot;Value&quot;
x := Acc_Get(Item, AccPath,, &quot;ahk_class&quot; sClass)
MsgBox % x
Return

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 = -4)
{
	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)
}

; 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[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2017-04-13T20:36:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115051#p115051</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115050#p115050" />
			<content type="html"><![CDATA[<p>В окне плеера VLC есть область отображения текущей скорости воспроизведения:<br /><span class="postimg"><img src="http://puu.sh/vjfAw/b6977d3c62.png" alt="http://puu.sh/vjfAw/b6977d3c62.png" /></span></p><p>Необходимо задать режим работы горячей клавиши в зависимости от текущей установленной скорости воспроизведения. Данный элемент не получилось определить как контрол, а только лишь как элемент, отображенный на скриншоте. Не знаю, как его использовать.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-13T19:43:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115050#p115050</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Accessible Info Viewer (Информация об элементах окна)]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=115047#p115047" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>как задать условие на основе параметра Name? Т.е. если Name = 1.00x, то..</p></blockquote></div><div class="codebox"><pre><code>If (Name = &quot;1.00x&quot;)
	MsgBox</code></pre></div><p>Если серьезно, надо уточнить, элемент нужен под курсором или в фокусе?<br />Вопрос нормально сформулируйте только.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2017-04-13T17:32:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=115047#p115047</id>
		</entry>
</feed>
