<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: залипает Shift]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14843&amp;type=atom" />
	<updated>2019-07-05T11:42:39Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14843</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134777#p134777" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, вроде решен вопрос, Благодаря <strong>terra-4</strong><br />send ^w пробовал, с моим недокодом залипало((.</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2019-07-05T11:42:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134777#p134777</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134776#p134776" />
			<content type="html"><![CDATA[<p><strong>terra-4</strong>, отлично, весьма признателен за помощь, за сутки ни одного залипания!)<br />Можете пожалуйста пояснить почему shift залипал с обычной реализацией send?</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2019-07-05T11:38:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134776#p134776</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134775#p134775" />
			<content type="html"><![CDATA[<p><strong>OmTatSat</strong>, вряд ли кто-то захочет копаться в вашей портянке кода, где уже первая строка <strong>a = &quot;&quot;</strong> наводит на мысль, что код будет запутанный и возможно с ошибками.<br />Приведите простой пример, где шифт у вас залипает, тогда можно будет расссмотреть.<br /><strong>terra-4</strong>, у меня так не залипает:<br /></p><div class="codebox"><pre><code>f11:: send ^w</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-07-04T13:12:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134775#p134775</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134774#p134774" />
			<content type="html"><![CDATA[<p><strong>terra-4</strong>, спасибо, попробую, отпишусь о результате.</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2019-07-04T12:08:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134774#p134774</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134773#p134773" />
			<content type="html"><![CDATA[<p>Это для закрытии страницы браузера, без залипания..</p><div class="codebox"><pre><code>vk6D::
KeyWait vk6D ; Ждать отпускания клавиши. Используйте одну команду
SendInput, {Blind}^{vk57} ;- закрыть страницу SendInput {Blind} ctrl+W
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[terra-4]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31073</uri>
			</author>
			<updated>2019-07-04T09:16:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134773#p134773</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134767#p134767" />
			<content type="html"><![CDATA[<p>Странно,<br /></p><div class="codebox"><pre><code>	Send, {Shift up}
	Send, ^w</code></pre></div><p>тоже перестал работать.<br />Зато сработал.<br /></p><div class="codebox"><pre><code>	Send, {Shift up}
	Send, &lt;^w</code></pre></div>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2019-07-03T11:42:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134767#p134767</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134766#p134766" />
			<content type="html"><![CDATA[<p>Ещё интересно почему<br /></p><div class="codebox"><pre><code>#Persistent
Settimer, EYE, 300
Settimer, EYE_s, 300
Return

EYE:
GetKeyState, state, Control
if state = D
{
SplashImage,,b x0 y715 H20 W50 ZY0 ZX0 fs9 ct1C3DB8 cw82BD3A, CONTROL, , ,Arial
   SetTimer, CHEkIFupCtrl, 200
Return

CHEkIFupCtrl:
GetKeyState, state, Control
if state = U
  {
   SplashImage, Off
   SetTimer, CHEkIFupCtrl, Off
  }
  Return
}

EYE_s:
GetKeyState, state, shift
if state = D
{
SplashImage,,b x0 y715 H20 W50 ZY0 ZX0 fs9 ct1C3DB8 cw82BD3A, SHIFT, , ,Arial
   SetTimer, CHEkIFupShift, 200
Return

CHEkIFupShift:
GetKeyState, state, Shift
if state = U
  {
   SplashImage, Off
   SetTimer, CHEkIFupShift, Off
  }
  Return
}</code></pre></div><p>Не отображает программно залипший Shift а только физическое нажатие?</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2019-07-03T11:35:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134766#p134766</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134765#p134765" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>stealzy пишет:</cite><blockquote><p>Если же нужно отдельными командами, прочтите про Blind.</p></blockquote></div><p>Отдельными не нужно, просто пробовал варианты, чтобы избавится от зависания Shift.<br />Почитал про Blind, не смог понять как поможет, можете в двух словах суть передать?</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2019-07-03T11:04:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134765#p134765</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134763#p134763" />
			<content type="html"><![CDATA[<p>Если перед <br /></p><div class="codebox"><pre><code>Send, ^w</code></pre></div><p>Выполнить<br /></p><div class="codebox"><pre><code>Send, {Shift up}</code></pre></div><p>То Send, ^w работает, но это же не правильно?</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2019-07-03T08:13:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134763#p134763</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134762#p134762" />
			<content type="html"><![CDATA[<p>Ещё заметил, когда скомпилированный скрипт перестаёт слать Send, то если запустить этот же скрипт просто кликнув 2 раза по .ahk файлу команда Send работает.</p>]]></content>
			<author>
				<name><![CDATA[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2019-07-03T08:06:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134762#p134762</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: залипает Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134761#p134761" />
			<content type="html"><![CDATA[<p>Здравствуйте, помогите разобраться, периодически send перестаёт работать, вновь начинает работать после физического нажатия Shift.<br />Пробовал SendInput и SendPlay, после send дополнительно слать Shift Up, проблема не убирается.<br />Что интересно, Shift зависает даже без использования хоткеев нажимающих Shift.</p><div class="codebox"><pre><code>#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn  ; Enable warnings to assist with detecting common errors.
;SendMode InputThenPlay  ; Recommended for new scripts due to its superior speed and reliability.

a = &quot;&quot;
#ifwinactive, ahk_class MozillaWindowClass
XButton1::  ;treeview get focused item
    {
      Sleep, 300
      If GetKeyState(&quot;XButton1&quot;, &quot;P&quot;) ; Если BIND отжат то выходит из цикла.
	{
         Send, ^w
		 ;Send, {ctrl up}
		 hwnd:=WinExist(&quot;ahk_exe back_button_history.exe&quot;)
		 sleep, 100
		 ToolTip, восстановить вкладку
		 return
	}
   }
WinGet, hWnd, ID, A
WinGet, Style, Style, A
if (style = &quot;0x170B0000&quot;)
	Send, {esc}

;oAcc := Acc_Get(&quot;Object&quot;, &quot;ahk_id &quot; hCtl)
;ToolTip, a-%a%
goto, exec1
	serch1:
if (a != &quot;&quot;)
{
 WinGet Path, ProcessPath, A
 FileGetVersion, Version, %Path%
Loop, read, %Version%.txt
	{
		Loop, parse, A_LoopReadLine, %A_Tab%
		{
			d := A_LoopField
			oAcc := Acc_Get(&quot;Object&quot;, d, 0, &quot;ahk_id &quot; hWnd)
			;ToolTip, читаю %d%
			;Sleep, 1000
			
			if (oAcc.accname(0) = &quot;Назад&quot;)
				goto, exec1
		}
	}
	;ToolTip, aa-%a%
	Loop, 99
	{
		;ToolTip, aaa-%a%
		if (oAcc.accname(0) != &quot;Панель навигации&quot;) 
			{
			c := A_Index+19
				d = 4.%c%
			}
			else
			{
				k := A_Index
				d = 4.%c%.%k%
			}
		
		;ToolTip, % d
		oAcc := Acc_Get(&quot;Object&quot;, d, 0, &quot;ahk_id &quot; hWnd)
		if (oAcc.accname(0) = &quot;Панель навигации&quot;) ;STATE_SYSTEM_FOCUSED := 0x4
		{
			;ToolTip, Панель навигации
			;sleep, 1000
			Loop
			{
			k := A_Index
			d = 4.%c%.%k%
			
			oAcc := Acc_Get(&quot;Object&quot;, d, 0, &quot;ahk_id &quot; hWnd)
			;ToolTip, % d
			
				if (oAcc.accname(0) = &quot;Назад&quot;) ;STATE_SYSTEM_FOCUSED := 0x4
					{
					vOutput := oAcc.accState(0)
					a = d
					 WinGet Path, ProcessPath, A

					 FileGetVersion, Version, %Path%
					 ;tooltip,  %Version% %Path%
					 ;FileAppend , % d%count% &quot;`n&quot;, %Version%.txt
					 FileRead, filetext, %Version%.txt ; get the file contents

						IfNotInString, filetext, %d% ; self-explanatory
							{
								FileDelete, %Version%.txt
								FileAppend , %d% `n%filetext%, %Version%.txt
							}

					break
					}
			}
			break
			
		}
	}
}

exec1:
		oAcc := Acc_Get(&quot;Object&quot;, d, 0, &quot;ahk_id &quot; hWnd)
		;ToolTip, exec1 %d%
		
vOutput := oAcc.accState(0)
;Clipboard := vOutput
;ToolTip, % vOutput
;ToolTip
;return
if ((vOutput = &quot;1073741825&quot;) or (vOutput = &quot;1&quot;))
{
	;ToolTip, работает
	Send, ^w
	;CoordMode, Mouse, Relative
hwnd:=WinExist(&quot;ahk_exe back_button_history.exe&quot;)
sleep, 200
		 ToolTip, восстановить вкладку
;SetTimer, Close_tooltip, 5000
;return
;Close_tooltip:
;ToolTip
	return
}
	if ((vOutput = &quot;1073741824&quot;) or (vOutput = &quot;0&quot;))
	{
		;ToolTip, НЕработает
	Sendinput, {Browser_Back}
	return
}
else
{
	a = &quot;&quot;
	Goto, serch1
}
;==================================================
#IfWinExist ahk_exe back_button_history.exe
~LButton Up::
{
hwnd:=WinExist(&quot;ahk_exe back_button_history.exe&quot;)
MouseGetPos,x,y,win
;tooltip, % win hwnd
;sleep, 1000
If win = %hwnd%
{
tooltip
;sleep, 100
	WinActivateBottom, ahk_class MozillaWindowClass
Send, {ctrl down}
Send, {shift down}
Send, {t}
sleep, 200
Send, {ctrl up}
Send, {shift up}
return
}

tooltip
return
}
XButton2::
{
tooltip
	WinActivateBottom, ahk_class MozillaWindowClass
Send, {ctrl down}{shift down}{t}{ctrl up}{shift up}
sleep, 200
Send, {ctrl up}{shift up}
return
}
#IfWinActive ahk_class MozillaWindowClass
XButton2::
   {
      Sleep, 300
      If GetKeyState(&quot;XButton2&quot;, &quot;P&quot;) ; Если BIND отжат то выходит из цикла.
	{
         Send, {ctrl down}{shift down}{t}{ctrl up}{shift up}
		 sleep, 200
Send, {ctrl up}{shift up}
Send, {ctrl up}{shift up}
		 return
	 }
	 	  Sendinput, {Browser_Forward}
	   return
   }

JEE_StrRept(vText, vNum)
{
	if (vNum &lt;= 0)
		return
	return StrReplace(Format(&quot;{:&quot; vNum &quot;}&quot;, &quot;&quot;), &quot; &quot;, vText)
	;return StrReplace(Format(&quot;{:0&quot; vNum &quot;}&quot;, 0), 0, vText)
}



; http://www.autohotkey.com/board/topic/77303-acc-library-ahk-l-updated-09272012/
; https://dl.dropbox.com/u/47573473/Web%20Server/AHK_L/Acc.ahk
;------------------------------------------------------------------------------
; 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
; last updated 2/25/2010
;------------------------------------------------------------------------------

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)
}
/*	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[OmTatSat]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33453</uri>
			</author>
			<updated>2019-07-03T07:35:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134761#p134761</id>
		</entry>
</feed>
