<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Как организовать слежение за курсором?]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=6270&amp;type=atom" />
	<updated>2016-04-16T19:14:41Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=6270</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=102642#p102642" />
			<content type="html"><![CDATA[<p>Спасибо. Номер курсора берётся. Но, почему-то, только один раз. При повторном обращении к функции, возвращается пустота.</p><p>UPD: Изменил переменную CURSORINFO со статической, на глобальную.<br /></p><div class="codebox"><pre><code>global CURSORINFO</code></pre></div><p>Вроде пошло веселее.</p>]]></content>
			<author>
				<name><![CDATA[Tsubasa]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26524</uri>
			</author>
			<updated>2016-04-16T19:14:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=102642#p102642</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=102640#p102640" />
			<content type="html"><![CDATA[<p><a href="https://github.com/jNizM/AHK_DllCall_WinAPI/tree/master/src/Cursor%20Functions">https://github.com/jNizM/AHK_DllCall_Wi … 0Functions</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-04-16T18:24:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=102640#p102640</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=102639#p102639" />
			<content type="html"><![CDATA[<p><strong>Александр_</strong> пять лет назад написал скрипт для слежения за курсором. При запуске мне выдаёт:<br /></p><div class="quotebox"><blockquote><p>Line Text: GetCursorInfo(CursorInfo)<br />Error: Parameters of hotkey functions must be optional.</p><p>The program will exit.</p></blockquote></div><p>Не подскажете, что не так?</p><br /><p>UPD: Я заменил вызов функции на её саму<br /></p><div class="codebox"><pre><code>DllCall(&quot;GetCursorInfo&quot;, &quot;int&quot;, CursorInfo)</code></pre></div><p>Ошибка пропала, но номер курсора отображается, как &quot;0&quot; для всех курсоров.</p><p>UPD2: В итоге, я не понимаю, как получить номер курсора.<br /></p><div class="codebox"><pre><code>
F11::
  #Persistent
  VarSetCapacity(ci,20), NumPut(20,ci) 
  DllCall(&quot;GetCursorInfo&quot;, &quot;Uint&quot;, &amp;ci) 
  hCursor := NumGet(ci,8)	
  ToolTip %hCursor%
return</code></pre></div><p>Выдаёт вечный ноль.</p>]]></content>
			<author>
				<name><![CDATA[Tsubasa]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26524</uri>
			</author>
			<updated>2016-04-16T16:37:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=102639#p102639</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52162#p52162" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>mih пишет:</cite><blockquote><p>Берётся Проводник. Чуть сдвигается левой кнопкой мыши любой файл. Имеем курсор &quot;No&quot; и совершенно случайное число от GetCursorInfo (a_lasterror вроде содержит нуль). Можно и правой сдвигать — другой курсор, картина та же. Возможно, это результат действия картинки файла, которая тянется за курсором?</p></blockquote></div><p>У меня тут перетаскивание иконок в проводнике никак не влияет на курсор(Win7 SP1, на других не проверял).</p>]]></content>
			<author>
				<name><![CDATA[Александр_]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24888</uri>
			</author>
			<updated>2011-10-04T11:49:38Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52162#p52162</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52136#p52136" />
			<content type="html"><![CDATA[<p>Берётся Проводник. Чуть сдвигается левой кнопкой мыши любой файл. Имеем курсор &quot;No&quot; и совершенно случайное число от GetCursorInfo (a_lasterror вроде содержит нуль). Можно и правой сдвигать — другой курсор, картина та же. Возможно, это результат действия картинки файла, которая тянется за курсором? <br />Тот же &quot;Nо&quot; в Опере стабильно имеет код&nbsp; 66581, а в фубаре, например —&nbsp; 3213319 — там они вроде бы постоянные в рамках приложения. Причём в Опере — &quot;No&quot; я могу получить сдвигом любой картинки (например, вправо на прокрутку, или вверх), и картинка тоже тянется за курсором.</p>]]></content>
			<author>
				<name><![CDATA[mih]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24883</uri>
			</author>
			<updated>2011-10-03T22:24:36Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52136#p52136</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52129#p52129" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>mih пишет:</cite><blockquote><p>Скрипт&nbsp; Александр_а различает курсоры, неизвестные для A_Cursor (напр., перст указующий и сжатый). Но с типом курсора &quot;NO&quot; дурит, число (гораздо больше, чем 65nnn) случайное.</p></blockquote></div><p>Так а что в этом случае возвращает GetCursorInfo и что лежит в a_lasterror? Я, к сожалению, не нашёл у себя приложений с нестандартными курсорами <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> .</p>]]></content>
			<author>
				<name><![CDATA[Александр_]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24888</uri>
			</author>
			<updated>2011-10-03T19:08:30Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52129#p52129</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52119#p52119" />
			<content type="html"><![CDATA[<p>Скрипт&nbsp; Александр_а различает курсоры, неизвестные для A_Cursor (напр., перст указующий и сжатый). Но с типом курсора &quot;NO&quot; дурит, число (гораздо больше, чем 65nnn) случайное.</p>]]></content>
			<author>
				<name><![CDATA[mih]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24883</uri>
			</author>
			<updated>2011-10-03T13:23:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52119#p52119</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52114#p52114" />
			<content type="html"><![CDATA[<p>Спасибо большое много полезного для себя подчеркнул, но решил свою проблему другим способом, всеже с помощью PixelSearch.</p>]]></content>
			<author>
				<name><![CDATA[metlick]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26594</uri>
			</author>
			<updated>2011-10-03T08:05:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52114#p52114</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52089#p52089" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>metlick пишет:</cite><blockquote><p>Да в игре.</p></blockquote></div><p>Ну вообще, получить информацию о текущем курсоре можно через функцию GetCursorInfo, но игры используют не стандартные системные функции, а специальные библиотеки(DirectX, OpenGL), которые работают с видео напрямую и могут не сообщить системе о смене курсора.<br /></p><div class="codebox"><pre><code>#Persistent
GetCursorInfo(CursorInfo)
; Функция извлекает информацию о текущем курсоре
; NumGet(CursorInfo,0,&quot;int&quot;)- размер структуры в байтах
; NumGet(CursorInfo,4,&quot;int&quot;)- показан курсор или скрыт
; NumGet(CursorInfo,8,&quot;int&quot;)- дескриптор курсора
; NumGet(CursorInfo,12,&quot;int&quot;)- координата x
; NumGet(CursorInfo,16,&quot;int&quot;)- координата y
{
   return DllCall(&quot;GetCursorInfo&quot;, &quot;int&quot;, CursorInfo)
}

VarSetCapacity(CursorInfo, 20)
NumPut(20,CursorInfo)
GetCursorInfo(&amp;CursorInfo)
cur:=NumGet(CursorInfo,8)

SetTimer Func, 200
return

Func:
   NumPut(20,CursorInfo)
   GetCursorInfo(&amp;CursorInfo)
   new:=NumGet(CursorInfo,8)
   if (new&lt;&gt;cur)
   {
      cur:=new
      ; курсор изменился
   }
   ToolTip %cur%
return</code></pre></div><p>если выше приведённый код не поможет, то посмотрите верно ли определяются координаты курсора и виден ли курсор с точки зрения ОС.</p>]]></content>
			<author>
				<name><![CDATA[Александр_]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24888</uri>
			</author>
			<updated>2011-10-02T10:45:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52089#p52089</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52088#p52088" />
			<content type="html"><![CDATA[<p><span style="color: Green"><strong>metlick</strong>, обратите внимание, как я исправил Ваш пост <a href="http://forum.script-coding.com/viewtopic.php?pid=52085#p52085">#11</a>, правильно оформив изображения. Впредь ожидаю от Вас такого же <a href="http://forum.script-coding.com/help.php#bbcode">корректного</a> оформления изображений.</span></p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-10-02T10:37:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52088#p52088</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52087#p52087" />
			<content type="html"><![CDATA[<p>Да в игре.</p>]]></content>
			<author>
				<name><![CDATA[metlick]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26594</uri>
			</author>
			<updated>2011-10-02T10:07:30Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52087#p52087</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52086#p52086" />
			<content type="html"><![CDATA[<p>Этот курсор только в какой-то определённой программе?</p>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-10-02T09:51:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52086#p52086</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52085#p52085" />
			<content type="html"><![CDATA[<p>c вот такого <span class="postimg"><img src="http://img843.imageshack.us/img843/8297/cursors0008.png" alt="http://img843.imageshack.us/img843/8297/cursors0008.png" /></span> на такой <span class="postimg"><img src="http://img37.imageshack.us/img37/4350/cursors0001.png" alt="http://img37.imageshack.us/img37/4350/cursors0001.png" /></span><br /></p><div class="quotebox"><blockquote><p>жмётся как?</p></blockquote></div><p>Не совсем понял вопрос, можно один раз, можно пока курсор опять не примет изначальный вид<br />так наверно MouseClick ,left<br />Дополню - оба изображения курсора раньше находились в файле с расширением .spr, но счас к самому файлу доступа нету(точнее он остался но изменение перестало влиять на его отображение), либо он както постоянно подгружается с сервера либо его както спрятали <img src="//forum.script-coding.com/img/smilies/hmm.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[metlick]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26594</uri>
			</author>
			<updated>2011-10-02T09:46:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52085#p52085</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52083#p52083" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>metlick пишет:</cite><blockquote><p>...как только внешний вид его меняется жмется допустим лкм.</p></blockquote></div><p>Меняется с какого на какой?, жмётся как?</p>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-10-02T08:18:36Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52083#p52083</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как организовать слежение за курсором?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=52076#p52076" />
			<content type="html"><![CDATA[<p>Спасибо огромное оч интересный скрипт,особенно фунуция ToolTip, но как я и предпологал определение параметров курсора мне ничего не дало:(. курсор в виде стрелки определяет как Cursor : Unknown и т.д, когда курсор становится рукой параметры не меняются.Сделал скрипт по нажатию лкм, не при 32648IDC_NO, не при 32649IDC_HAND ничнго не происходит,хотя опять таки извеняюсь, возможно проблема только в моей нехватке знаний по данному вопросу <img src="//forum.script-coding.com/img/smilies/hmm.png" width="15" height="15" />.</p>]]></content>
			<author>
				<name><![CDATA[metlick]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26594</uri>
			</author>
			<updated>2011-10-01T19:48:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=52076#p52076</id>
		</entry>
</feed>
