<?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="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12326&amp;type=atom" />
	<updated>2017-01-18T15:04:23Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12326</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111221#p111221" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>DllCall(&quot;gdiplus\GdipCreatePen1&quot;, Int, ((RippleAlpha -= RippleAlphaStep) &lt;&lt; 24) | RippleColor, float, <strong>30</strong>, Int, 2, UIntP, pRipplePen)<br />&nbsp; &nbsp; &nbsp; &nbsp; DllCall(&quot;gdiplus\GdipDrawEllipse&quot;, UInt, pRippleGraphics, UInt, pRipplePen, float, <strong>15</strong>, float, <strong>15</strong>, float, RippleDiameter <strong>- 25</strong>, float, RippleDiameter <strong>- 25</strong>)</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-18T15:04:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111221#p111221</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111218#p111218" />
			<content type="html"><![CDATA[<p>Malcev, Спасибо, за скрипт!</p><p>Подскажите пожалуйста.. можно ли изменить&nbsp; толщину кругов? если да то какой параметр отвечает за это?</p>]]></content>
			<author>
				<name><![CDATA[terra-4]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31073</uri>
			</author>
			<updated>2017-01-18T14:08:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111218#p111218</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111205#p111205" />
			<content type="html"><![CDATA[<p>Объекты удалил.<br />Хотя, судя по этой теме это делать вроде необязательно.<br />Виндовс сам все подчистит при выходе из программы:<br /><a href="http://stackoverflow.com/questions/30157624/what-are-the-consequences-of-not-calling-gdiplusshutdown-before-exiting-an-appli">http://stackoverflow.com/questions/3015 … g-an-appli</a><br />Размерность сам точно не поменяю.<br />Беды с ней особо не вижу - на 64 бит у меня работает.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-18T04:13:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111205#p111205</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111197#p111197" />
			<content type="html"><![CDATA[<p>Объекты, созданные в начале скрипта, обязательно должны удаляться. Ну и с размерностью опять беда.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-01-17T21:27:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111197#p111197</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111194#p111194" />
			<content type="html"><![CDATA[<p>Можно регулировать прозрачность RippleAlphaMax.<br />При значении 500 у меня видно.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-17T19:01:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111194#p111194</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111193#p111193" />
			<content type="html"><![CDATA[<p>Вот так показывает анимацию. Но в стандартном варианте мелькания. </p><div class="codebox"><pre><code>~LButton:: Send {LCtrl}</code></pre></div><p><strong>Malcev</strong>, ещё бы для полного счастья учесть чёрный фон, на нём не видно.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2017-01-17T18:28:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111193#p111193</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111192#p111192" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#NoEnv
OnExit, ExitSub
CoordMode Mouse, Screen
Setup()

~LButton::ShowRipple(LeftClickRippleColor)
~RButton::ShowRipple(RightClickRippleColor)
~LControl Up::ShowRipple(MouseIdleRippleColor)

Setup()
{
    Global
    RippleWinSize := 200
    RippleStep := 10
    RippleMinSize := 10
    RippleMaxSize := RippleWinSize - 20
    RippleAlphaMax := 0x60
    RippleAlphaStep := RippleAlphaMax // ((RippleMaxSize - RippleMinSize) / RippleStep)
    RippleVisible := False
    LeftClickRippleColor := 0xff0000
    RightClickRippleColor := 0x0000ff
    MouseIdleRippleColor := 0x008000
    
    DllCall(&quot;LoadLibrary&quot;, Str, &quot;gdiplus.dll&quot;)
    VarSetCapacity(buf, 16, 0)
    NumPut(1, buf)
    DllCall(&quot;gdiplus\GdiplusStartup&quot;, UIntP, pToken, UInt, &amp;buf, UInt, 0)
    
    Gui Ripple: -Caption +LastFound +AlwaysOnTop +ToolWindow +Owner +E0x80000
    Gui Ripple: Show, NA, RippleWin
    hRippleWin := WinExist(&quot;RippleWin&quot;)
    hRippleDC := DllCall(&quot;GetDC&quot;, UInt, 0)
    VarSetCapacity(buf, 40, 0)
    NumPut(40, buf, 0)
    NumPut(RippleWinSize, buf, 4)
    NumPut(RippleWinSize, buf, 8)
    NumPut(1, buf, 12, &quot;ushort&quot;)
    NumPut(32, buf, 14, &quot;ushort&quot;)
    NumPut(0, buf, 16)
    hRippleBmp := DllCall(&quot;CreateDIBSection&quot;, UInt, hRippleDC, UInt, &amp;buf, UInt, 0, UIntP, ppvBits, UInt, 0, UInt, 0)
    DllCall(&quot;ReleaseDC&quot;, UInt, 0, UInt, hRippleDC)
    hRippleDC := DllCall(&quot;CreateCompatibleDC&quot;, UInt, 0)
    DllCall(&quot;SelectObject&quot;, UInt, hRippleDC, UInt, hRippleBmp)
    DllCall(&quot;gdiplus\GdipCreateFromHDC&quot;, UInt, hRippleDC, UIntP, pRippleGraphics)
    DllCall(&quot;gdiplus\GdipSetSmoothingMode&quot;, UInt, pRippleGraphics, Int, 4)
    
    MouseGetPos _lastX, _lastY
    SetTimer MouseIdleTimer, 5000
    Return

MouseIdleTimer:
    MouseGetPos _x, _y
    if (_x == _lastX and _y == _lastY)
        ShowRipple(MouseIdleRippleColor, _interval:=20)
    else
        _lastX := _x, _lastY := _y
    Return
}

ShowRipple(_color, _interval:=10)
{
    Global
    if (RippleVisible)
    	Return
    RippleColor := _color
    RippleDiameter := RippleMinSize
    RippleAlpha := RippleAlphaMax
    RippleVisible := True

    MouseGetPos _pointerX, _pointerY
    SetTimer RippleTimer, % _interval
    Return

RippleTimer:
    DllCall(&quot;gdiplus\GdipGraphicsClear&quot;, UInt, pRippleGraphics, Int, 0)
    if ((RippleDiameter += RippleStep) &lt; RippleMaxSize) {
        DllCall(&quot;gdiplus\GdipCreatePen1&quot;, Int, ((RippleAlpha -= RippleAlphaStep) &lt;&lt; 24) | RippleColor, float, 3, Int, 2, UIntP, pRipplePen)
        DllCall(&quot;gdiplus\GdipDrawEllipse&quot;, UInt, pRippleGraphics, UInt, pRipplePen, float, 1, float, 1, float, RippleDiameter - 1, float, RippleDiameter - 1)
        DllCall(&quot;gdiplus\GdipDeletePen&quot;, UInt, pRipplePen)
    }
    else {
        RippleVisible := False
        SetTimer RippleTimer, Off
    }

    VarSetCapacity(buf, 8)
    NumPut(_pointerX - RippleDiameter // 2, buf, 0)
    NumPut(_pointerY - RippleDiameter // 2, buf, 4)
    DllCall(&quot;UpdateLayeredWindow&quot;, UInt, hRippleWin, UInt, 0, UInt, &amp;buf, Int64p, (RippleDiameter + 5) | (RippleDiameter + 5) &lt;&lt; 32, UInt, hRippleDC, Int64p, 0, UInt, 0, UIntP, 0x1FF0000, UInt, 2)
    Return
}

ExitSub:
DllCall(&quot;DeleteObject&quot;, &quot;ptr&quot;, hRippleBmp)
DllCall(&quot;DeleteDC&quot;, &quot;ptr&quot;, hRippleDC)
DllCall(&quot;gdiplus\GdipDeleteGraphics&quot;, &quot;ptr&quot;, pRippleGraphics)
DllCall(&quot;gdiplus\GdiplusShutdown&quot;, &quot;uptr&quot;, pToken)
if hModule := DllCall(&quot;GetModuleHandle&quot;, &quot;str&quot;, &quot;gdiplus&quot;, &quot;ptr&quot;)
   DllCall(&quot;FreeLibrary&quot;, &quot;ptr&quot;, hModule)
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-17T18:18:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111192#p111192</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111191#p111191" />
			<content type="html"><![CDATA[<p>Как вариант можно отправить нажатие ctrl в окно, которое не реагирует на него. Например нажал ЛКМ - разворачивается заранее открытое окно блокнота, туда отправляется ctrl, окно сворачивается. Правда я бы сказал как это называется, да тут форум приличный <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-17T17:49:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111191#p111191</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111190#p111190" />
			<content type="html"><![CDATA[<p>Сомневаюсь, что без gdi+ что-то можно путное сделать.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-17T15:04:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111190#p111190</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111189#p111189" />
			<content type="html"><![CDATA[<p><strong>terra-4</strong>, некорректные действия можно обойти только тогда, когда данное окно не реагирует на клавишу LCRTL - не важно какие задержки. Возможно ypppu объяснит, как можно это сделать стандартными средствами.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-17T13:43:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111189#p111189</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111184#p111184" />
			<content type="html"><![CDATA[<p>Задача была про анимацию щелчков ЛКМ. И она успешно решается стандартными средствами. При чём тут SendInput {LControl}? Для чего вообще скрипт писать?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2017-01-17T13:19:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111184#p111184</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111180#p111180" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong>, да нажатие CTLR всегда, после нажатии ЛКМ, но как некорректные действие можно обойти.. я поставил &quot;Sleep 80&quot; возможно тут только подбирать паузу между действиями.</p><p>А есть у вас, идея как что то подобное сделать средствами AutoHotkey?</p>]]></content>
			<author>
				<name><![CDATA[terra-4]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31073</uri>
			</author>
			<updated>2017-01-17T11:35:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111180#p111180</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111177#p111177" />
			<content type="html"><![CDATA[<p>Некорректные действия связаны с тем, что у тебя идёт нажатие клавиши CTLR.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-01-17T10:51:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111177#p111177</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Анимация при нажатии ЛКМ]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111174#p111174" />
			<content type="html"><![CDATA[<p>Всем Хорошего времени суток.</p><p>Пожалуйста, помогите&nbsp; со скрипом.</p><p>Задача скрипта, сигнализировать при нажатии ЛКМ, мне известно про такую возможность виде сходящихся кругов в&nbsp; Панель управления - Мышь - Параметры указателя = Обозначить расположения указателя при нажатии CTRL (установить галочку)..</p><p>На основе этой возможности в Windows, мне удалось собрать это:</p><div class="codebox"><pre><code>~LButton::
	Sleep 80
		SendInput {LControl}
return</code></pre></div><p>К сожалению, иногда работает некорректно, вызывая незапланированные действия, возможно, это связано с задержкой…</p><p>Может у кого есть что то лучше поделитесь, пожалуйста.</p>]]></content>
			<author>
				<name><![CDATA[terra-4]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31073</uri>
			</author>
			<updated>2017-01-17T09:29:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111174#p111174</id>
		</entry>
</feed>
