<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Зона курсора]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=13478</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13478&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Зона курсора».]]></description>
		<lastBuildDate>Mon, 19 Feb 2018 17:56:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Зона курсора]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123781#p123781</link>
			<description><![CDATA[<p>Можно с помощью winapi-функции <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms648383(v=vs.85).aspx">ClipCursor</a>. Пример использования, для наглядности красная рамка по границе области:<br /></p><div class="codebox"><pre><code>Clip:
   ClipCursor( (A_ScreenWidth - 400)/2, (A_ScreenHeight - 400)/2, 400, 400 )
   Return
   
$F10:: Gosub, Clip
$F11:: ClipCursor()
$Esc:: ExitApp

ClipCursor(x := &quot;&quot;, y := &quot;&quot;, w := &quot;&quot;, h := &quot;&quot;)  {
   static myFrame, _ := OnExit( Func(&quot;ClipCursor&quot;).Bind(&quot;&quot;) )
   if (x = &quot;&quot;)
      DllCall(&quot;ClipCursor&quot;, Ptr, 0), myFrame := &quot;&quot;
   else  {
      VarSetCapacity(RECT, 16, 0)
      NumPut(x, RECT)
      NumPut(y, RECT, 4)
      NumPut(x + w + 1, RECT, 8)
      NumPut(y + h + 1, RECT, 12, &quot;Int&quot;)
      DllCall(&quot;ClipCursor&quot;, Ptr, &amp;RECT)
      myFrame := new ColoredFrame(x, y, w, h, 3, 0xFF0000)
   }
}

class ColoredFrame
{
   __New(x, y, width, height, thickness, color)  {
      Gui, New, +hwndhGui +ToolWindow -Caption +LastFound +AlwaysOnTop -DPIScale +E0x20 ; WS_EX_TRANSPARENT = 0x20
      Gui, Color, %color%
      this.hGui := hGui

      t := thickness, w := width + t*2, h := height + t*2
      dx := width + t, dy := height + t, x -= t, y -= t
      
      WinSet, Region, 0-0 %w%-0 %w%-%h% 0-%h% 0-0 %t%-%t% %dx%-%t% %dx%-%dy% %t%-%dy% %t%-%t%
      WinSet, Transparent, 0xFF
      Gui, Show, NA x%x% y%y% w%w% h%h%
   }
   
   __Delete()  {
      Gui, % this.hGui &quot;: Destroy&quot;
   }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 19 Feb 2018 17:56:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123781#p123781</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Зона курсора]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=123778#p123778</link>
			<description><![CDATA[<p>Возможно ли запретить курсору заходить на заданную зону?<br />Иль наоборот ограничить его перемещение зоной?</p><p>Mousemove конечно хорош, но он дерганый.</p>]]></description>
			<author><![CDATA[null@example.com (shahlik002)]]></author>
			<pubDate>Sun, 18 Feb 2018 22:18:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=123778#p123778</guid>
		</item>
	</channel>
</rss>
