<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: получить координаты мышки как в AhkSpy]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=16527</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16527&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: получить координаты мышки как в AhkSpy».]]></description>
		<lastBuildDate>Tue, 10 Aug 2021 12:27:29 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149220#p149220</link>
			<description><![CDATA[<p>Предыдущий вариант.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 10 Aug 2021 12:27:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149220#p149220</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149219#p149219</link>
			<description><![CDATA[<p><strong>teadrinker</strong> так тоже работает, как предпочтительней? Что быстрее работает и меньше нагружает пк?</p>]]></description>
			<author><![CDATA[null@example.com (OmTatSat)]]></author>
			<pubDate>Tue, 10 Aug 2021 08:35:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149219#p149219</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149218#p149218</link>
			<description><![CDATA[<p>Эти кнопки не являются контролами. Можно так:<br /></p><div class="codebox"><pre><code>~LButton::
   CoordMode, Mouse
   MouseGetPos, X, Y
   AccObj := AccObjectFromPoint(child)
   Pos := AccLocation(AccObj, child)
   ToolTip, % &quot;X: &quot; . X - Pos.x . &quot; Y:&quot; . Y - Pos.y
   Return

AccObjectFromPoint(ByRef _idChild_ = &quot;&quot;, x = &quot;&quot;, y = &quot;&quot;) {
   static VT_DISPATCH := 9, F_OWNVALUE := 1, h := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;oleacc&quot;, &quot;Ptr&quot;)
   
   AccObject := 0
   (x = &quot;&quot; || y = &quot;&quot;) ? DllCall(&quot;GetCursorPos&quot;, &quot;Int64P&quot;, pt) : pt := x &amp; 0xFFFFFFFF | y &lt;&lt; 32
   VarSetCapacity(varChild, 8 + 2*A_PtrSize, 0)
   if	DllCall(&quot;oleacc\AccessibleObjectFromPoint&quot;, &quot;Int64&quot;, pt, &quot;PtrP&quot;, pAcc, &quot;Ptr&quot;, &amp;varChild) = 0
      _idChild_ := NumGet(varChild, 8, &quot;UInt&quot;), AccObject := ComObject(VT_DISPATCH, pAcc, F_OWNVALUE)
   Return AccObject
}

AccLocation(Acc, ChildId := 0, ByRef Position := &quot;&quot;) {
   static type := (VT_BYREF := 0x4000) | (VT_I4 := 3)
   try Acc.accLocation( ComObject(type, &amp;x := 0), ComObject(type, &amp;y := 0)
                      , ComObject(type, &amp;w := 0), ComObject(type, &amp;h := 0), ChildId )
   catch
      Return
   _x := NumGet(x, &quot;int&quot;), _y := NumGet(y, &quot;int&quot;), _w = NumGet(w, &quot;int&quot;), _h := NumGet(h, &quot;int&quot;)
   Position := &quot;x&quot; . _x . &quot; y&quot; . _y . &quot; w&quot; . _w . &quot; h&quot; . _h
   Return {x: _x, y: _y, w: _w, h: _h}
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 10 Aug 2021 08:29:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149218#p149218</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149217#p149217</link>
			<description><![CDATA[<p><strong>teadrinker</strong> спасибо ещё раз, чуть подправил ваш вариант, перешел - на ahk_id и получил то, что хотел.</p><div class="codebox"><pre><code>mButton::
   CoordMode, Mouse
   MouseGetPos, x, y,ahk_id, hCtrl, 2
   WinGetPos, xCtrl, yCtrl,,, ahk_id %ahk_id%
   ToolTip, % &quot;X: &quot; . x - xCtrl . &quot; Y:&quot; . y - yCtrl &quot;`n&quot; &quot;x:&quot; x &quot;`n&quot; &quot;xctrl:&quot; xctrl &quot;`n&quot; &quot;hCtrl:&quot; hCtrl &quot;`n&quot; &quot;ahk_id:&quot; ahk_id
   Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (OmTatSat)]]></author>
			<pubDate>Tue, 10 Aug 2021 08:28:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149217#p149217</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149216#p149216</link>
			<description><![CDATA[<p>MouseGetPos, x, y,, hCtrl, 2</p><p>hCtrl выдаёт пустое значение над кнопками.</p>]]></description>
			<author><![CDATA[null@example.com (OmTatSat)]]></author>
			<pubDate>Tue, 10 Aug 2021 08:15:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149216#p149216</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149215#p149215</link>
			<description><![CDATA[<p>Проверил, xCtrl над кнопками выдаёт пустое значение, в другой области окна получает значение.<br />DetectHiddenWindows, on не помогает.</p>]]></description>
			<author><![CDATA[null@example.com (OmTatSat)]]></author>
			<pubDate>Tue, 10 Aug 2021 08:12:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149215#p149215</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149214#p149214</link>
			<description><![CDATA[<p><strong>teadrinker</strong> да, вы правы, не полностью повторил ваш код - в тултип вывел координаты с wingetpos.<br />Если полностью повторить ваш вариант, то в тултипе пустые координаты.<br /><span class="postimg"><img src="http://forum.script-coding.com/misc.php?action=pun_attachment&amp;item=2211&amp;download=0" alt="http://forum.script-coding.com/misc.php?action=pun_attachment&amp;amp;item=2211&amp;amp;download=0" /></span></p>]]></description>
			<author><![CDATA[null@example.com (OmTatSat)]]></author>
			<pubDate>Tue, 10 Aug 2021 07:42:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149214#p149214</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149212#p149212</link>
			<description><![CDATA[<p>Этот код показывает именно положение курсора относительно верхнего левого угла контрола, над которым он находится.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 10 Aug 2021 07:05:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149212#p149212</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149211#p149211</link>
			<description><![CDATA[<p><strong>teadrinker</strong> Спасибо, так получил размер другой области - уже существенный прогресс, но мне нужно положение курсора мышки в этой области, чтобы знать над какой кнопкой мышка находится.</p>]]></description>
			<author><![CDATA[null@example.com (OmTatSat)]]></author>
			<pubDate>Tue, 10 Aug 2021 06:54:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149211#p149211</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149210#p149210</link>
			<description><![CDATA[<p>Попробуйте так:<br /></p><div class="codebox"><pre><code>~LButton::
   CoordMode, Mouse
   MouseGetPos, x, y,, hCtrl, 2
   WinGetPos, xCtrl, yCtrl,,, ahk_id %hCtrl%
   ToolTip, % &quot;X: &quot; . x - xCtrl . &quot; Y:&quot; . y - yCtrl
   Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 10 Aug 2021 00:38:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149210#p149210</guid>
		</item>
		<item>
			<title><![CDATA[AHK: получить координаты мышки как в AhkSpy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=149209#p149209</link>
			<description><![CDATA[<p>Здравствуйте, в окне есть 2 области с разными ahk_id, AhkSpy определяет позицию мышки в соответствии положения мышки в области.<br />Но когда я использую mousegetpos, то получаю координаты позиции в соответствии с полным размером окна.<br />CoordMode, Mouse, Client ничего не меняет. Стандартный Active Window Info также не меняет координаты для разных методов CoordMode.<br />Как получить координаты мышки как в AhkSpy а именно - как в скрине х = 25?</p><p><span class="postimg"><img src="http://forum.script-coding.com/misc.php?action=pun_attachment&amp;item=2210&amp;download=0" alt="http://forum.script-coding.com/misc.php?action=pun_attachment&amp;amp;item=2210&amp;amp;download=0" /></span></p>]]></description>
			<author><![CDATA[null@example.com (OmTatSat)]]></author>
			<pubDate>Mon, 09 Aug 2021 23:27:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=149209#p149209</guid>
		</item>
	</channel>
</rss>
