<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=9799</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9799&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)».]]></description>
		<lastBuildDate>Fri, 18 Sep 2015 19:28:33 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=97565#p97565</link>
			<description><![CDATA[<p><strong>teadrinker,</strong> Просто похожие вопросы. Думал ответ легче будет найти в этой теме.&nbsp; Наверное, будет лучше создать отдельную тему. Прошу прощения.</p>]]></description>
			<author><![CDATA[null@example.com (Тимур)]]></author>
			<pubDate>Fri, 18 Sep 2015 19:28:33 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=97565#p97565</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=97564#p97564</link>
			<description><![CDATA[<p><strong>Тимур</strong>, а <a href="http://forum.script-coding.com/rules.html#3.11.">какое</a> отношение ваш вопрос имеет к этой теме?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 18 Sep 2015 19:23:40 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=97564#p97564</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=97561#p97561</link>
			<description><![CDATA[<p>Помогите, пожалуйста, исправить код.<br />Нужно, чтобы курсор запомнил своё текущее положение, переместился в определенных экранных координатах, нажал правую кнопку мыши и вернулся в исходное положение.<br />Но при этом хотелось бы иметь возможность физически управлять перемещением мыши, а скрипт независимо от этого выполнял свою функцию.<br />Нижеприведенный код работает, только если не управлять мышью физически.</p><div class="codebox"><pre><code>sy:= A_ScreenHeight*(990/1024)
sx:= A_ScreenWidth*(30/1280)
MouseGetPos x, y
MouseClick R, %sx%, %sy%, 1, 0
MouseMove %x%, %y%, 0</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Тимур)]]></author>
			<pubDate>Fri, 18 Sep 2015 18:07:09 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=97561#p97561</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=85002#p85002</link>
			<description><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=6148">Обновите AHK</a>.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 22 Jul 2014 16:15:30 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=85002#p85002</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=85000#p85000</link>
			<description><![CDATA[<p>Добрый день. </p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Курсор должен быть перемещён в точку (500, 500) в экранных координатах. А у вас что получается?</p></blockquote></div><p>Ничего не происходит.</p>]]></description>
			<author><![CDATA[null@example.com (S.shipilov)]]></author>
			<pubDate>Tue, 22 Jul 2014 15:52:45 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=85000#p85000</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84783#p84783</link>
			<description><![CDATA[<p>Курсор должен быть перемещён в точку (500, 500) в экранных координатах. А у вас что получается?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 15 Jul 2014 12:37:37 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84783#p84783</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84782#p84782</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><div class="codebox"><pre><code>API_SendInputMouse(500, 500)

API_SendInputMouse(x, y)
{
   static INPUT_MOUSE := 0, MOUSEEVENTF_ABSOLUTE := 0x8000, MOUSEEVENTF_MOVE := 1
   
   VarSetCapacity(INPUT, SizeOfINPUT := A_PtrSize + 4*4 + 2*A_PtrSize)
   NumPut(INPUT_MOUSE, INPUT, &quot;UInt&quot;)
   NumPut(Round(x/A_ScreenWidth*0xFFFF), INPUT, A_PtrSize, &quot;UInt&quot;)
   NumPut(Round(y/A_ScreenHeight*0xFFFF), INPUT, A_PtrSize + 4, &quot;UInt&quot;)
   NumPut(0, INPUT, A_PtrSize + 4*2, &quot;UInt&quot;)
   NumPut(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, INPUT, A_PtrSize + 4*3, &quot;UInt&quot;)
   NumPut(0, INPUT, A_PtrSize + 4*4, &quot;UInt&quot;)
   NumPut(0, INPUT, A_PtrSize + 4*4 + A_PtrSize)
   
   DllCall(&quot;SendInput&quot;, UInt, 1, Ptr, &amp;INPUT, Int, SizeOfINPUT)
}</code></pre></div></blockquote></div><p>прошу прощения, но каков должен быть результат запуска данного кода?</p>]]></description>
			<author><![CDATA[null@example.com (S.shipilov)]]></author>
			<pubDate>Tue, 15 Jul 2014 12:24:22 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84782#p84782</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84774#p84774</link>
			<description><![CDATA[<div class="codebox"><pre><code>API_SendInputMouse(500, 500)

API_SendInputMouse(x, y)
{
   static INPUT_MOUSE := 0, MOUSEEVENTF_ABSOLUTE := 0x8000, MOUSEEVENTF_MOVE := 1
   
   VarSetCapacity(INPUT, SizeOfINPUT := A_PtrSize + 4*4 + 2*A_PtrSize)
   NumPut(INPUT_MOUSE, INPUT, &quot;UInt&quot;)
   NumPut(Round(x/A_ScreenWidth*0xFFFF), INPUT, A_PtrSize, &quot;UInt&quot;)
   NumPut(Round(y/A_ScreenHeight*0xFFFF), INPUT, A_PtrSize + 4, &quot;UInt&quot;)
   NumPut(0, INPUT, A_PtrSize + 4*2, &quot;UInt&quot;)
   NumPut(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, INPUT, A_PtrSize + 4*3, &quot;UInt&quot;)
   NumPut(0, INPUT, A_PtrSize + 4*4, &quot;UInt&quot;)
   NumPut(0, INPUT, A_PtrSize + 4*4 + A_PtrSize)
   
   DllCall(&quot;SendInput&quot;, UInt, 1, Ptr, &amp;INPUT, Int, SizeOfINPUT)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 14 Jul 2014 21:37:43 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84774#p84774</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84767#p84767</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Winapi функция SendInput также не предоставляет возможности управления скоростью перемещения курсора между двумя точками.</p></blockquote></div><p>Спасибо. Далее вопрос имеет сугубо академический характер нежели практический поскольку основное пожелание к работе с Winapi&nbsp; функцией SendInput не выполнимо.</p>]]></description>
			<author><![CDATA[null@example.com (S.shipilov)]]></author>
			<pubDate>Mon, 14 Jul 2014 13:24:36 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84767#p84767</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84731#p84731</link>
			<description><![CDATA[<p>Вывод: winapi функции mouse_event и SendInput с указанием относительных координат не годятся для цели, обозначенной ТС.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 12 Jul 2014 15:41:17 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84731#p84731</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84730#p84730</link>
			<description><![CDATA[<p><strong>teadrinker</strong> тяжело для не окрепшей психики, можешь выводы привести, а то не даётся...</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 12 Jul 2014 15:11:59 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84730#p84730</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84727#p84727</link>
			<description><![CDATA[<p>Функция mouse_event используется для интерпретации движений мыши. Можно провести такой эксперимент. Установим курсор примерно в центр экрана возле какой-либо точки, от которой можно вести отсчёт. Теперь сдвинем мышь (не курсор, а именно мышь) влево на сантиметр, но не сразу, а маленькими отдельными движениями. Курсор сдвигается влево на определённое расстояние, зависящее от системных настроек скорости мыши. Теперь сдвинем мышь (не курсор, а именно мышь) на то же расстояние вправо, только одним быстрым движением. Курсор не вернётся в исходную точку, а переместится гораздо правее. Вот <a href="http://msdn.microsoft.com/en-us/library/aa227574%28v=vs.60%29.aspx">здесь</a> описан алгоритм расчёта движения курсора.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 12 Jul 2014 14:28:12 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84727#p84727</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84724#p84724</link>
			<description><![CDATA[<p>Как-то странно ведет себя <em>DllCall(&quot;mouse_event&quot;...</em><br />Если заменить на <em>SendEvent</em>, как предложил <strong>serzh82saratov</strong>, то при абсолютно том же алгоритме результат получается корректным.</p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Sat, 12 Jul 2014 14:07:18 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84724#p84724</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84722#p84722</link>
			<description><![CDATA[<p><strong>Irbis</strong>:<br /></p><div class="codebox"><pre><code>F1::
MouseMove, 100, 600
Sleep, 1000

mouseXY(100,-100,10)
MouseGetPos, X1, Y1
Sleep, 1000

mouseXY(100,-100, 1000)
MouseGetPos, X2, Y2

MsgBox, % &quot;Пройденный путь 1: &quot; Round(((X1 - 100)**2 + (Y1 + (-600))**2)**0.5)
      . &quot;`nПройденный путь 2: &quot; Round(((X2 - X1)**2 + (Y2 + (-Y1))**2)**0.5)
Return

mouseXY(x,y,s) 
{
   dx:=0,dy:=0, dx0:=0, dy0:=0
   loop % s
   {
      DllCall(&quot;mouse_event&quot;,uint,1,int
              ,dx0:=Round(dx := dx+x/s - dx0),int
              ,dy0:=Round(dy := dy+y/s - dy0),uint,0,int,0) 
   }
}</code></pre></div><p><img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 12 Jul 2014 12:40:59 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84722#p84722</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:[Dllcall] Вопрос по синтаксису Dllcall ("Sendinput"...)]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=84721#p84721</link>
			<description><![CDATA[<p>Тогда уж и DllCall упразднить.<br /></p><div class="codebox"><pre><code>
SetBatchLines -1 

1:: 
    mouseXY(1111,-555,111) 
    Return

mouseXY(x,y,s)  {
    Loop % s + (dx:=dy:=dx0:=dy0:=0)
        SendEvent % &quot;{Click, &quot; (dx0:=Round(dx:=dx+x/s-dx0)) &quot;,&quot; 
            . (dy0:=Round(dy:=dy+y/s-dy0)) &quot;, 0, Rel}&quot;
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 12 Jul 2014 12:32:00 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=84721#p84721</guid>
		</item>
	</channel>
</rss>
