<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Команда ControlClick]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=5063</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=5063&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Команда ControlClick».]]></description>
		<lastBuildDate>Fri, 19 Feb 2016 02:59:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=101220#p101220</link>
			<description><![CDATA[<p>Ну, раз с ними глючит, значит правильнее без них. Именно для работы этого скрипта в нужных программах, а не вообще.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Fri, 19 Feb 2016 02:59:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=101220#p101220</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=101219#p101219</link>
			<description><![CDATA[<p>Код из 2 поста у меня работает в блокноте и при закомментированных:<br /></p><div class="codebox"><pre><code>; PostMessage, 0x201, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONDOWN 
; PostMessage, 0x202, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONUP </code></pre></div><p>Если же их раскомментировать и использовать в Adobe Premiere, то посылается иногда 3 клика вместо 2.<br />Может быть двойной клик правильней посылать без WM_LBUTTONDOWN WM_LBUTTONUP?<br />Хотя майкрософт пишет:<br /></p><div class="quotebox"><blockquote><p>Double-clicking the left mouse button actually generates a sequence of four messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and WM_LBUTTONUP</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 19 Feb 2016 00:51:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=101219#p101219</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40665#p40665</link>
			<description><![CDATA[<p>Так вот как надо... Попробовал, заработало, спасибо:). А можно ли заставить эту команду работать не по координатам, а как-то иначе?:) Как-нибудь заставить находить место ссылки по тексту на ней?</p>]]></description>
			<author><![CDATA[null@example.com (Skare)]]></author>
			<pubDate>Thu, 21 Oct 2010 07:51:19 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40665#p40665</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40658#p40658</link>
			<description><![CDATA[<p>Тот код из 2 поста остается неизменным, а ту строку, что дал YMP в посте #5 написать перед всем этим кодом из поста #2.<br />Я попробовал, но у меня почему-то не делает двойной клик, точнее не кликает вообще.</p>]]></description>
			<author><![CDATA[null@example.com (InFlames)]]></author>
			<pubDate>Wed, 20 Oct 2010 19:54:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40658#p40658</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40657#p40657</link>
			<description><![CDATA[<p>Ах, нет.:(<br />Тогда получается код будет такой:<br /></p><div class="codebox"><pre><code>ControlClick2(57, 115, &quot;Список GSM в ремонте - Windows Internet Explorer&quot;)
{ 
  hwnd:=ControlFromPoint(X, Y, WinTitle, WinText, cX, cY 
                             , ExcludeTitle, ExcludeText) 
  PostMessage, 0x201, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONDOWN 
  PostMessage, 0x202, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONUP 
  PostMessage, 0x203, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONDBLCLCK 
  PostMessage, 0x202, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONUP 
} 

; Retrieves the control at the specified point. 
; X         [in]    X-coordinate relative to the top-left of the window. 
; Y         [in]    Y-coordinate relative to the top-left of the window. 
; WinTitle  [in]    Title of the window whose controls will be searched. 
; WinText   [in] 
; cX        [out]   X-coordinate relative to the top-left of the control. 
; cY        [out]   Y-coordinate relative to the top-left of the control. 
; ExcludeTitle [in] 
; ExcludeText  [in] 
; Return Value:     The hwnd of the control if found, otherwise the hwnd of the window. 
ControlFromPoint(X, Y, WinTitle=&quot;&quot;, WinText=&quot;&quot;, ByRef cX=&quot;&quot;, ByRef cY=&quot;&quot;, ExcludeTitle=&quot;&quot;, ExcludeText=&quot;&quot;) 
{ 
    static EnumChildFindPointProc=0 
    if !EnumChildFindPointProc 
        EnumChildFindPointProc := RegisterCallback(&quot;EnumChildFindPoint&quot;,&quot;Fast&quot;) 
    
    if !(target_window := WinExist(WinTitle, WinText, ExcludeTitle, ExcludeText)) 
        return false 
    
    VarSetCapacity(rect, 16) 
    DllCall(&quot;GetWindowRect&quot;,&quot;uint&quot;,target_window,&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;,target_window,&quot;uint&quot;,EnumChildFindPointProc,&quot;uint&quot;,&amp;pah) 
    control_window := NumGet(pah,24) ? NumGet(pah,24) : target_window 
    DllCall(&quot;ScreenToClient&quot;,&quot;uint&quot;,control_window,&quot;uint&quot;,&amp;pah) 
    cX:=NumGet(pah,0,&quot;int&quot;), cY:=NumGet(pah,4,&quot;int&quot;) 
    return control_window 
} 

; Ported from AutoHotkey::script2.cpp::EnumChildFindPoint() 
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><p>Но тогда ошибка уже такая:<br /><span class="postimg"><img src="http://i016.radikal.ru/1010/69/5ba007748960.jpg" alt="http://i016.radikal.ru/1010/69/5ba007748960.jpg" /></span></p>]]></description>
			<author><![CDATA[null@example.com (Skare)]]></author>
			<pubDate>Wed, 20 Oct 2010 19:42:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40657#p40657</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40654#p40654</link>
			<description><![CDATA[<p>А сами функции в скрипт вставил? Те, что в посте <a href="http://forum.script-coding.com/viewtopic.php?pid=40635#p40635">#2</a>.</p>]]></description>
			<author><![CDATA[null@example.com (InFlames)]]></author>
			<pubDate>Wed, 20 Oct 2010 19:20:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40654#p40654</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40652#p40652</link>
			<description><![CDATA[<p>Извините, AHK выдаёт.<br /><span class="postimg"><img src="http://s58.radikal.ru/i162/1010/62/e37d14fb286f.png" alt="http://s58.radikal.ru/i162/1010/62/e37d14fb286f.png" /></span></p>]]></description>
			<author><![CDATA[null@example.com (Skare)]]></author>
			<pubDate>Wed, 20 Oct 2010 18:40:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40652#p40652</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40651#p40651</link>
			<description><![CDATA[<p>Кто выдаёт и какую ошибку? Я же не телепат всё-таки.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Wed, 20 Oct 2010 18:30:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40651#p40651</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40650#p40650</link>
			<description><![CDATA[<p>Как я понимаю, для клика по координатам 100, 215 в браузере на определённой страничке надо делать так:<br /></p><div class="codebox"><pre><code>ControlClick2(57, 115, &quot;Страничка - Windows Internet Explorer&quot;)</code></pre></div><p>Вот только почему-то выдаёт ошибку:(.</p>]]></description>
			<author><![CDATA[null@example.com (Skare)]]></author>
			<pubDate>Wed, 20 Oct 2010 18:18:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40650#p40650</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40645#p40645</link>
			<description><![CDATA[<p>Вызвать функцию ControlClick2, указав нужные Вам координаты и целевое окно. Координаты относительно этого окна.<br /></p><div class="codebox"><pre><code>ControlClick2(57, 115, &quot;ahk_class Notepad&quot;)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Wed, 20 Oct 2010 17:58:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40645#p40645</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40639#p40639</link>
			<description><![CDATA[<p>Нужно просто открыть эту ссылку, при условии, что она открывается только двойным щелчком.<br />InFlames, не открывается.:|<br />To YMP, не совсем понял, как это применять?:)</p>]]></description>
			<author><![CDATA[null@example.com (Skare)]]></author>
			<pubDate>Wed, 20 Oct 2010 16:48:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40639#p40639</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40637#p40637</link>
			<description><![CDATA[<p>А после выделения ссылки если нажать Ентер, она не открывается?</p>]]></description>
			<author><![CDATA[null@example.com (InFlames)]]></author>
			<pubDate>Wed, 20 Oct 2010 16:18:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40637#p40637</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40635#p40635</link>
			<description><![CDATA[<p>Не совсем понял. Если нужен двойной щелчок (а не два отдельных), то ControlClick его не умеет делать. Вот тут это обсуждалось: <a href="http://www.autohotkey.com/forum/topic16826.html">ControlClick fails to perform a double click in the Pos mode</a>. Там же был найден обходной путь, оформленный в виде функции ControlClick2, производящей двойной щелчок по координатам. Две функции под ней тоже нужны, она их использует.<br /></p><div class="codebox"><pre><code>ControlClick2(X, Y, WinTitle=&quot;&quot;, WinText=&quot;&quot;, ExcludeTitle=&quot;&quot;, ExcludeText=&quot;&quot;) 
{ 
  hwnd:=ControlFromPoint(X, Y, WinTitle, WinText, cX, cY 
                             , ExcludeTitle, ExcludeText) 
  PostMessage, 0x201, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONDOWN 
  PostMessage, 0x202, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONUP 
  PostMessage, 0x203, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONDBLCLCK 
  PostMessage, 0x202, 0, cX&amp;0xFFFF | cY&lt;&lt;16,, ahk_id %hwnd% ; WM_LBUTTONUP 
} 

; Retrieves the control at the specified point. 
; X         [in]    X-coordinate relative to the top-left of the window. 
; Y         [in]    Y-coordinate relative to the top-left of the window. 
; WinTitle  [in]    Title of the window whose controls will be searched. 
; WinText   [in] 
; cX        [out]   X-coordinate relative to the top-left of the control. 
; cY        [out]   Y-coordinate relative to the top-left of the control. 
; ExcludeTitle [in] 
; ExcludeText  [in] 
; Return Value:     The hwnd of the control if found, otherwise the hwnd of the window. 
ControlFromPoint(X, Y, WinTitle=&quot;&quot;, WinText=&quot;&quot;, ByRef cX=&quot;&quot;, ByRef cY=&quot;&quot;, ExcludeTitle=&quot;&quot;, ExcludeText=&quot;&quot;) 
{ 
    static EnumChildFindPointProc=0 
    if !EnumChildFindPointProc 
        EnumChildFindPointProc := RegisterCallback(&quot;EnumChildFindPoint&quot;,&quot;Fast&quot;) 
    
    if !(target_window := WinExist(WinTitle, WinText, ExcludeTitle, ExcludeText)) 
        return false 
    
    VarSetCapacity(rect, 16) 
    DllCall(&quot;GetWindowRect&quot;,&quot;uint&quot;,target_window,&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;,target_window,&quot;uint&quot;,EnumChildFindPointProc,&quot;uint&quot;,&amp;pah) 
    control_window := NumGet(pah,24) ? NumGet(pah,24) : target_window 
    DllCall(&quot;ScreenToClient&quot;,&quot;uint&quot;,control_window,&quot;uint&quot;,&amp;pah) 
    cX:=NumGet(pah,0,&quot;int&quot;), cY:=NumGet(pah,4,&quot;int&quot;) 
    return control_window 
} 

; Ported from AutoHotkey::script2.cpp::EnumChildFindPoint() 
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 (YMP)]]></author>
			<pubDate>Wed, 20 Oct 2010 16:06:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40635#p40635</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Команда ControlClick]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40633#p40633</link>
			<description><![CDATA[<p>Возникла проблема с командой ControlClick. При отправке 2ух кликов в Интернет эксплорер командой, происходит только выделение ссылки(1). Как сделать так, что бы при посылке кликов открывалась ссылка, а не просто выделялась?(При ручном нажатии на ссылку-она открывается в новом окне)<br />Скриншот прилагается:<br /><span class="postimg"><img src="http://s49.radikal.ru/i125/1010/82/1fe5f307a2fe.jpg" alt="http://s49.radikal.ru/i125/1010/82/1fe5f307a2fe.jpg" /></span></p>]]></description>
			<author><![CDATA[null@example.com (Skare)]]></author>
			<pubDate>Wed, 20 Oct 2010 15:00:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40633#p40633</guid>
		</item>
	</channel>
</rss>
