<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: ControlGetText и .NET Framework WinForms]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=9561</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9561&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: ControlGetText и .NET Framework WinForms».]]></description>
		<lastBuildDate>Tue, 06 May 2014 10:42:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82698#p82698</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>достаточно быть первым найденным.</p></blockquote></div><p>А&nbsp; да, нужны уточнения role и <strong>ChildId</strong> в <strong>AccObj.accName(2)</strong>. Как переделать чтобы ChildId знать не нужно было.<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>
#SingleInstance Force
#Persistent    
#NoEnv
ListLines Off 
DetectHiddenWindows, on
SetBatchLines -1 
SetFormat, IntegerFast, h
 
winid := WinExist(&quot;ahk_class IEFrame ahk_exe iexplore.exe&quot;)
name = Избранное 
role = панель инструментов

hwnd := HwndFromAccName(winid, name, role)
ControlGet, thwnd, Hwnd,, ToolbarWindow324, ahk_id %winid%
MsgBox, % hwnd &quot;   &quot; thwnd
ControlGetText, str,, ahk_id %hwnd%
MsgBox, % str
return 

HwndFromAccName(winid, name, role)
{
    if !winid
        MsgBox, % &quot;Окно не найдено&quot;  
    else if !IsObject(AccObj := AccObjectFromWindow(winid))
        MsgBox, % &quot;Не удалось получить IAccessible&quot; 
    else if !IsObject(oExist := ExistAccName(AccObj, name, role, hwnd)) || !hwnd
        MsgBox, % &quot;Элемент не найден&quot; 
    else 
        Return hwnd
}     

ExistAccName(AccObj, name, role, byref hwnd=&quot;&quot;)
{   
    try if (AccRole(AccObj) = role &amp;&amp; AccObj.accName(2) = name)
        Return AccObj, hwnd := AccWindowFromObject(AccObj) 
    for k, v in AccChildren(AccObj)
        if IsObject(obj := ExistAccName(v, name, role, hwnd)) 
        Return obj 
}  

AccWindowFromObject(pacc)
{
    If DllCall(&quot;oleacc\WindowFromAccessibleObject&quot;, &quot;Ptr&quot;, IsObject(pacc)?ComObjValue(pacc):pacc, &quot;Ptr*&quot;, hWnd) = 0
    Return    hWnd
} 
AccInit()
{
   Static   h
   If Not   h
      h:=DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,&quot;oleacc&quot;,&quot;Ptr&quot;)
}

AccObjectFromWindow(hWnd, idObject = 0)
{
   AccInit()
   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)
}        
AccRole(Acc, ChildId=0) {
    try Return ComObjType(Acc,&quot;Name&quot;)=&quot;IAccessible&quot;?AccGetRoleText(Acc.accRole(ChildId)):&quot;&quot;
}
AccGetRoleText(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
}
AccError(p=&quot;&quot;) {
   static setting:=0
   return p=&quot;&quot;?setting:setting:=p
}
AccQuery(Acc) {
    try return ComObj(9, ComObjQuery(Acc,&quot;{618736e0-3c3d-11cf-810c-00aa00389b71}&quot;), 1)
}
AccChildren(Acc) {
   if ComObjType(Acc,&quot;Name&quot;) != &quot;IAccessible&quot;
      ErrorLevel := &quot;Invalid IAccessible Object&quot;
   else {
      AccInit(), 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?AccQuery(child):child), NumGet(varChildren,i-8)=9?ObjRelease(child):
         return Children.MaxIndex()?Children:
      } else
         ErrorLevel := &quot;AccessibleChildren DllCall Failed&quot;
   }
   if AccError()
      throw Exception(ErrorLevel,-1)
}
  
Esc::   
    ExitApp 
</code></pre></div></div></div><br /><p>UPD: Дошло.</p><div class="codebox"><pre><code>
#SingleInstance Force  
#NoEnv
ListLines Off  
SetBatchLines -1  

WinTitle = ahk_class IEFrame ahk_exe iexplore.exe
name = Избранное 
role = панель инструментов

winid := WinExist(WinTitle)
hwnd := HwndFromAccName(winid, role, name)
ControlGet, thwnd, Hwnd,, ToolbarWindow324, ahk_id %winid%
MsgBox, % hwnd &quot;   &quot; thwnd+0
ControlGetText, str,, ahk_id %hwnd%
MsgBox, % str
return 

HwndFromAccName(winid, role, name)
{
    if !winid
        MsgBox, % &quot;Окно не найдено&quot;  
    else if !IsObject(AccObj := AccObjectFromWindow(winid))
        MsgBox, % &quot;Не удалось получить IAccessible&quot; 
    else if !IsObject(AccObj := ExistAccName(AccObj, role, name))
        MsgBox, % &quot;Элемент не найден&quot; 
    else
        Return AccWindowFromObject(AccObj) 
}     

ExistAccName(AccObj, role, name)
{   
    if (AccRole(AccObj) = role) 
        loop % AccObj.accChildCount
            if AccObj.accName(A_Index-1) = name 
                Return AccObj
    for k, v in AccChildren(AccObj)
        if IsObject(obj := ExistAccName(v, role, name)) 
            Return obj 
}  

AccWindowFromObject(pacc)
{
    If DllCall(&quot;oleacc\WindowFromAccessibleObject&quot;, &quot;Ptr&quot;, IsObject(pacc)?ComObjValue(pacc):pacc, &quot;Ptr*&quot;, hWnd) = 0
    Return    hWnd
} 
AccInit()
{
   Static   h
   If Not   h
      h:=DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,&quot;oleacc&quot;,&quot;Ptr&quot;)
}

AccObjectFromWindow(hWnd, idObject = 0)
{
   AccInit()
   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)
}        
AccRole(Acc, ChildId=0) {
    try Return ComObjType(Acc,&quot;Name&quot;)=&quot;IAccessible&quot;?AccGetRoleText(Acc.accRole(ChildId)):&quot;&quot;
}
AccGetRoleText(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
}
AccError(p=&quot;&quot;) {
   static setting:=0
   return p=&quot;&quot;?setting:setting:=p
}
AccQuery(Acc) {
    try return ComObj(9, ComObjQuery(Acc,&quot;{618736e0-3c3d-11cf-810c-00aa00389b71}&quot;), 1)
}
AccChildren(Acc) {
   if ComObjType(Acc,&quot;Name&quot;) != &quot;IAccessible&quot;
      ErrorLevel := &quot;Invalid IAccessible Object&quot;
   else {
      AccInit(), 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?AccQuery(child):child), NumGet(varChildren,i-8)=9?ObjRelease(child):
         return Children.MaxIndex()?Children:
      } else
         ErrorLevel := &quot;AccessibleChildren DllCall Failed&quot;
   }
   if AccError()
      throw Exception(ErrorLevel,-1)
}
  
Esc::   
    ExitApp 
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Tue, 06 May 2014 10:42:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82698#p82698</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82696#p82696</link>
			<description><![CDATA[<p>А какой в итоге код должен быть? Что то Я не пойму как hwnd контрола вернуть, возвращает нечто не то:<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>
#SingleInstance Force
#Persistent    
#NoEnv
ListLines Off 
DetectHiddenWindows, on
SetBatchLines -1 
SetFormat, IntegerFast, h

winid := WinExist(&quot;ahk_class IEFrame ahk_exe iexplore.exe&quot;)
name = Избранное 

hwnd := HwndFromAccName(winid, name)
ControlGet, thwnd, Hwnd,, ToolbarWindow324, ahk_id %winid%
MsgBox, % hwnd &quot;   &quot; thwnd
return 

ExistAccName(AccObj, name, byref hwnd=&quot;&quot;)
{  
    if (AccObj.accName(0) = name) 
        Return AccObj, hwnd := AccWindowFromObject(AccObj) 
    for k, v in AccChildren(AccObj)
        if IsObject(obj := ExistAccName(v, name, hwnd)) 
        Return obj 
}  

HwndFromAccName(winid, name)
{
    if !winid
        MsgBox, % &quot;Окно не найдено&quot;  
    else if !IsObject(AccObj := AccObjectFromWindow(winid))
        MsgBox, % &quot;Не удалось получить IAccessible&quot; 
    else if !IsObject(oExist := ExistAccName(AccObj, name, hwnd)) || !hwnd
        MsgBox, % &quot;Элемент с таким именем не найден&quot; 
    else 
        Return hwnd
}     

AccWindowFromObject(pacc)
{
    If DllCall(&quot;oleacc\WindowFromAccessibleObject&quot;, &quot;Ptr&quot;, IsObject(pacc)?ComObjValue(pacc):pacc, &quot;Ptr*&quot;, hWnd) = 0
    Return    hWnd
} 
AccInit()
{
   Static   h
   If Not   h
      h:=DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,&quot;oleacc&quot;,&quot;Ptr&quot;)
}

AccObjectFromWindow(hWnd, idObject = 0)
{
   AccInit()
   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)
}        
AccError(p=&quot;&quot;) {
   static setting:=0
   return p=&quot;&quot;?setting:setting:=p
}
AccQuery(Acc) {
    try return ComObj(9, ComObjQuery(Acc,&quot;{618736e0-3c3d-11cf-810c-00aa00389b71}&quot;), 1)
}
AccChildren(Acc) {
   if ComObjType(Acc,&quot;Name&quot;) != &quot;IAccessible&quot;
      ErrorLevel := &quot;Invalid IAccessible Object&quot;
   else {
      AccInit(), 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?AccQuery(child):child), NumGet(varChildren,i-8)=9?ObjRelease(child):
         return Children.MaxIndex()?Children:
      } else
         ErrorLevel := &quot;AccessibleChildren DllCall Failed&quot;
   }
   if AccError()
      throw Exception(ErrorLevel,-1)
}
  
Esc::   
    ExitApp 
</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Tue, 06 May 2014 08:23:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82696#p82696</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82672#p82672</link>
			<description><![CDATA[<p>Навряд ли, но ему не обязательно быть уникальным, достаточно быть первым найденным.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 05 May 2014 12:31:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82672#p82672</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82670#p82670</link>
			<description><![CDATA[<p>Наверное, с .NET Framework WinForms не сталкивался. Может быть там accName как уникальные идентификаторы.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 05 May 2014 12:11:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82670#p82670</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82669#p82669</link>
			<description><![CDATA[<p>Я-то откуда знаю? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Но если вопрос решается подобным образом, значит решение устраивает.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 05 May 2014 12:07:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82669#p82669</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82668#p82668</link>
			<description><![CDATA[<p>Имеешь ввиду, что совпадений быть не может?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 05 May 2014 12:06:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82668#p82668</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82667#p82667</link>
			<description><![CDATA[<p>Но ведь</p><div class="quotebox"><cite>cmdz пишет:</cite><blockquote><p>в AutoIt v3 например мой вопрос решается просто:<br /></p><div class="codebox"><pre><code>ControlGetText($hWnd, &quot;&quot;, &quot;[NAME:lblTime]&quot;)</code></pre></div></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 05 May 2014 12:04:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82667#p82667</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82664#p82664</link>
			<description><![CDATA[<p><strong>bWRmeA</strong><br />Так что Вы именно предлагаете? Перебирать все контролы окна на соответствие accName? Так может быть много совпадений.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 05 May 2014 09:58:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82664#p82664</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82616#p82616</link>
			<description><![CDATA[<p>[NAME:] это&nbsp; <a href="http://msdn.microsoft.com/en-us/library/accessibility.iaccessible.accname%28v=vs.110%29.aspx">accName</a></p>]]></description>
			<author><![CDATA[null@example.com (bWRmeA)]]></author>
			<pubDate>Sat, 03 May 2014 16:57:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82616#p82616</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82599#p82599</link>
			<description><![CDATA[<p>У меня работает первый <a href="http://forum.script-coding.com/viewtopic.php?pid=79253#p79253">вариант </a><br />буду тестить...</p>]]></description>
			<author><![CDATA[null@example.com (cmdz)]]></author>
			<pubDate>Sat, 03 May 2014 12:57:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82599#p82599</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82598#p82598</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>20% не считываются.</p></blockquote></div><p>Может IsWindowVisible мешается:<br /></p><div class="codebox"><pre><code>
1::   
    ControlGetText, str, , % &quot;ahk_id&quot; CtrlID(12, 77, WinExist(&quot;ahk_class Notepad&quot;))   
    ToolTip % str
    Return 
    
CtrlID(X, Y, Wnd)   { 
    WinGet, List, ControlListHwnd, ahk_id %Wnd%    
    Loop, parse, List, `n
    {  
        ControlGetPos, cX, cY, cW, cH, , ahk_id %A_LoopField% 
        If (cX &lt;= X &amp;&amp; cY &lt;= Y &amp;&amp; cX+cW &gt;= X &amp;&amp; cY+cH &gt;= Y) 
            id := A_LoopField
    }  
    Return id
} 
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 03 May 2014 12:51:19 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82598#p82598</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82597#p82597</link>
			<description><![CDATA[<p>OOO, просто отлично, в коде не разбирался, но работает (хотя не для всех контролов) 20% не считываются.<br />Меня пока это устраивает. Дома буду разбираться.</p><p>С вами приятно общаться. Все остаюсь... <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (cmdz)]]></author>
			<pubDate>Sat, 03 May 2014 12:45:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82597#p82597</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82596#p82596</link>
			<description><![CDATA[<p>Так по короче: <a href="http://forum.script-coding.com/viewtopic.php?pid=79306#p79306">отсюда</a>.<br /></p><div class="codebox"><pre><code>

1::   
    ControlGetText, str, , % &quot;ahk_id&quot; CtrlID(12, 77, WinExist(&quot;ahk_class Notepad&quot;))   
    ToolTip % str
    Return 
    
CtrlID(X, Y, Wnd)   { 
    WinGet, List, ControlListHwnd, ahk_id %Wnd%    
    Loop, parse, List, `n
    { 
        If !DllCall(&quot;IsWindowVisible&quot;, &quot;uint&quot;, A_LoopField) 
            Continue
        ControlGetPos, cX, cY, cW, cH, , ahk_id %A_LoopField% 
        If (cX &lt;= X &amp;&amp; cY &lt;= Y &amp;&amp; cX+cW &gt;= X &amp;&amp; cY+cH &gt;= Y) 
            id := A_LoopField
    }  
    Return id
} 
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 03 May 2014 12:32:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82596#p82596</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82595#p82595</link>
			<description><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?pid=79253#p79253">Отсюда</a><br /></p><div class="codebox"><pre><code>
1::
HWND := ControlIdFromPoint(12, 77, WinExist(&quot;ahk_class Notepad&quot;))
ControlGetText, str, , ahk_id %HWND%
MsgBox % str
return

ControlIdFromPoint(X, Y, HW) 
{ 
    static EnumChildFindPointProc=0 
    if !EnumChildFindPointProc 
        EnumChildFindPointProc := RegisterCallback(&quot;EnumChildFindPoint&quot;,&quot;Fast&quot;)   
    VarSetCapacity(rect, 16) 
    DllCall(&quot;GetWindowRect&quot;,&quot;uint&quot;,HW,&quot;uint&quot;,&amp;rect) 
    VarSetCapacity(pah, 36, 0) 
    NumPut(X + NumGet(rect,0,&quot;int&quot;), pah,0,&quot;int&quot;) 
    NumPut(Y + NumGet(rect,4,&quot;int&quot;), pah,4,&quot;int&quot;) 
    DllCall(&quot;EnumChildWindows&quot;,&quot;uint&quot;,HW,&quot;uint&quot;,EnumChildFindPointProc,&quot;uint&quot;,&amp;pah)  
    return NumGet(pah,24) 
} 

EnumChildFindPoint(aWnd, lParam) 
{ 
    if !DllCall(&quot;IsWindowVisible&quot;,&quot;uint&quot;,aWnd) 
        return true  
    VarSetCapacity(rect, 16) 
    if !DllCall(&quot;GetWindowRect&quot;,&quot;uint&quot;,aWnd,&quot;uint&quot;,&amp;rect) 
        return true 
    pt_x:=NumGet(lParam+0,0,&quot;int&quot;), pt_y:=NumGet(lParam+0,4,&quot;int&quot;) 
    rect_left:=NumGet(rect,0,&quot;int&quot;), rect_right:=NumGet(rect,8,&quot;int&quot;) 
    rect_top:=NumGet(rect,4,&quot;int&quot;), rect_bottom:=NumGet(rect,12,&quot;int&quot;) 
    if (pt_x &gt;= rect_left &amp;&amp; pt_x &lt;= rect_right &amp;&amp; pt_y &gt;= rect_top &amp;&amp; pt_y &lt;= rect_bottom) 
    { 
        center_x := rect_left + (rect_right - rect_left) / 2 
        center_y := rect_top + (rect_bottom - rect_top) / 2 
        distance := Sqrt((pt_x-center_x)**2 + (pt_y-center_y)**2) 
        update_it := !NumGet(lParam+24) 
        if (!update_it) 
        { 
            rect_found_left:=NumGet(lParam+8,0,&quot;int&quot;), rect_found_right:=NumGet(lParam+8,8,&quot;int&quot;) 
            rect_found_top:=NumGet(lParam+8,4,&quot;int&quot;), rect_found_bottom:=NumGet(lParam+8,12,&quot;int&quot;) 
            if (rect_left &gt;= rect_found_left &amp;&amp; rect_right &lt;= rect_found_right 
                &amp;&amp; rect_top &gt;= rect_found_top &amp;&amp; rect_bottom &lt;= rect_found_bottom) 
                update_it := true 
            else if (distance &lt; NumGet(lParam+28,0,&quot;double&quot;) 
                &amp;&amp; (rect_found_left &lt; rect_left || rect_found_right &gt; rect_right 
                 || rect_found_top &lt; rect_top || rect_found_bottom &gt; rect_bottom)) 
                 update_it := true 
        } 
        if (update_it) 
        { 
            NumPut(aWnd, lParam+24) 
            DllCall(&quot;RtlMoveMemory&quot;,&quot;uint&quot;,lParam+8,&quot;uint&quot;,&amp;rect,&quot;uint&quot;,16) 
            NumPut(distance, lParam+28, 0, &quot;double&quot;) 
        } 
    } 
    return true 
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 03 May 2014 12:27:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82595#p82595</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ControlGetText и .NET Framework WinForms]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=82594#p82594</link>
			<description><![CDATA[<div class="quotebox"><cite>polyethene пишет:</cite><blockquote><p>.NET windows forms, like Java Swing or AWT, do not respond by default to standard windows messages so Control commands will not work.</p><p><a href="http://www.autohotkey.com/board/topic/34856-bug-with-controlget-and-application-using-windowsforms/">http://www.autohotkey.com/board/topic/3 … dowsforms/</a></p></blockquote></div><p>но это сообщение от 2008 года, надо копать дальше. Есть предложения?</p>]]></description>
			<author><![CDATA[null@example.com (cmdz)]]></author>
			<pubDate>Sat, 03 May 2014 12:18:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=82594#p82594</guid>
		</item>
	</channel>
</rss>
