<?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>http://forum.script-coding.com/viewtopic.php?id=11447</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=11447&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Экранная лупа».]]></description>
		<lastBuildDate>Sat, 27 Jul 2019 15:51:08 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=135075#p135075</link>
			<description><![CDATA[<p>&quot;Сляпал&quot; себе лупу для Win 10 (на x86 не проверял), теперь понадобилось запустить её на Win 7. Что-то опять голова не варит.<br />Посмотрите, пожалуйста.</p><div class="codebox"><pre><code>; Источник: https://autohotkey.com/board/topic/88701-magnifier-for-win7-how-to-use-the-magnification-api/

#Singleinstance force
#NoEnv
#Persistent
;#Include %a_scriptdir%/Gdip.ahk
SetBatchLines -1
Coordmode, Mouse, Screen
OnExit, Uninitialize

zoomlevel := 2
Interface_update_speed = 1
w_size:=600
h_size:=200

Gui GUI_Drawing:+AlwaysOnTop -Caption +E0x80000 +hwndhGui -Border +ToolWindow +OwnDialogs +Owner +LastFound -E0x20
GUI GUI_Drawing:Show,NA,GUI_Drawing

Gdip_Startup()
hdc := CreateCompatibleDC()
hbm := CreateDIBSection(1,1,hdc)
SelectObject(hdc, hbm)



; Create magnifier control
hInstance := DllCall(&quot;GetWindowLong&quot;, &quot;Ptr&quot;, hGui, &quot;Ptr&quot;, GWL_HINSTANCE:=-6)
DllCall(&quot;LoadLibrary&quot;, &quot;str&quot;, &quot;magnification.dll&quot;)
DllCall(&quot;magnification.dll\MagInitialize&quot;)
DllCall(&quot;magnification\MagSetWindowFilterList&quot;,&quot;UPtr&quot;, magHwnd, &quot;Uint&quot;, 0, &quot;Int&quot;, 1, &quot;UPtr*&quot;, hGui) ; MW_Filtermode_Exclude

magHwnd := DllCall(&quot;CreateWindowEx&quot;
	, &quot;Ptr&quot;, 0
	, &quot;Str&quot;, &quot;Magnifier&quot;
	, &quot;Str&quot;, &quot;MagnifierWindow&quot;
	, &quot;Ptr&quot;, WS_CHILD := 0x40000000 | MS_SHOWMAGNIFIEDCURSOR := 0x1 | WS_VISIBLE := 0x10000000
	, &quot;Int&quot;, 0
	, &quot;Int&quot;, 0
	, &quot;Int&quot;, a_screenwidth*2
	, &quot;Int&quot;, a_screenheight*2
	, &quot;Ptr&quot;, hGui
	, &quot;Ptr&quot;, 0
	, &quot;Ptr&quot;, hInstance
	, &quot;Ptr&quot;, 0)

; Magnification transform matrix (Initializing the control)

gosub,ChangeZoom

loop
{
  sleep,% Interface_update_speed
  if (zoomlevel&gt;1)
  {
    doonce=
    MouseGetPos, now_x, now_y
    cs_x := now_x - (w_size)/2
    cs_y := now_y - (h_size)/2
    VarSetCapacity(magRECT, 16)
    NumPut(cs_x, magRECT, 0, &quot;uint&quot;), NumPut(cs_y, magRECT, 4, &quot;uint&quot;)
    DllCall(&quot;magnification.dll\MagSetWindowSource&quot;, &quot;Ptr&quot;, magHwnd, &quot;Ptr&quot;, &amp;magRECT)
    UpdateLayeredWindow(hGui, hdc, now_x - (w_size)/2*zoomlevel, now_y - (h_size)/2*zoomlevel, w_size*zoomlevel, h_size*zoomlevel)
  }
  else if !doonce
  {
    doonce=1
    UpdateLayeredWindow(hGui,hdc,0,0,1,1,0)
  }
}
return


^WheelUp::
if (zoomlevel&lt;10)
  zoomlevel++
gosub,ChangeZoom
return

^WheelDown::
if (zoomlevel&gt;1)
  zoomlevel--
gosub,ChangeZoom
return



ChangeZoom:
Matrix := zoomlevel &quot;|0|0|&quot;
        . &quot;0|&quot; zoomlevel &quot;|0|&quot;
        . &quot;0|0|&quot; zoomlevel
StringSplit, Matrix, Matrix, |
VarSetCapacity(magMatrix, 36, 0)
Loop, 9
  NumPut(Matrix, magMatrix, (A_Index-1)*4, &quot;float&quot;)
DllCall(&quot;magnification.dll\MagSetWindowTransform&quot;, &quot;Ptr&quot;, magHwnd, &quot;Ptr&quot;, &amp;magMatrix)
tooltip,% (zoomlevel&gt;1) ? zoomlevel : &quot;Off&quot;
settimer,tooltip,-1000
return

tooltip:
tooltip
return

Uninitialize:
Esc::
DllCall(&quot;magnification.dll\MagUninitialize&quot;)
ExitApp


; ------------------- from gdip library --------------------
UpdateLayeredWindow(hwnd, hdc, x=&quot;&quot;, y=&quot;&quot;, w=&quot;&quot;, h=&quot;&quot;, Alpha=255)
{
	Ptr := A_PtrSize ? &quot;UPtr&quot; : &quot;UInt&quot;

	if ((x != &quot;&quot;) &amp;&amp; (y != &quot;&quot;))
		VarSetCapacity(pt, 8), NumPut(x, pt, 0, &quot;UInt&quot;), NumPut(y, pt, 4, &quot;UInt&quot;)

	if (w = &quot;&quot;) ||(h = &quot;&quot;)
		WinGetPos,,, w, h, ahk_id %hwnd%

	return DllCall(&quot;UpdateLayeredWindow&quot;
					, Ptr, hwnd
					, Ptr, 0
					, Ptr, ((x = &quot;&quot;) &amp;&amp; (y = &quot;&quot;)) ? 0 : &amp;pt
					, &quot;int64*&quot;, w|h&lt;&lt;32
					, Ptr, hdc
					, &quot;int64*&quot;, 0
					, &quot;uint&quot;, 0
					, &quot;UInt*&quot;, Alpha&lt;&lt;16|1&lt;&lt;24
					, &quot;uint&quot;, 2)
}
; ------------------- from gdip library --------------------

CreateDIBSection(w, h, hdc=&quot;&quot;, bpp=32, ByRef ppvBits=0)
{
	Ptr := A_PtrSize ? &quot;UPtr&quot; : &quot;UInt&quot;

	hdc2 := hdc ? hdc : GetDC()
	VarSetCapacity(bi, 40, 0)

	NumPut(w, bi, 4, &quot;uint&quot;)
	, NumPut(h, bi, 8, &quot;uint&quot;)
	, NumPut(40, bi, 0, &quot;uint&quot;)
	, NumPut(1, bi, 12, &quot;ushort&quot;)
	, NumPut(0, bi, 16, &quot;uInt&quot;)
	, NumPut(bpp, bi, 14, &quot;ushort&quot;)

	hbm := DllCall(&quot;CreateDIBSection&quot;
					, Ptr, hdc2
					, Ptr, &amp;bi
					, &quot;uint&quot;, 0
					, A_PtrSize ? &quot;UPtr*&quot; : &quot;uint*&quot;, ppvBits
					, Ptr, 0
					, &quot;uint&quot;, 0, Ptr)

	if !hdc
		ReleaseDC(hdc2)
	return hbm
}

SelectObject(hdc, hgdiobj)
{
	Ptr := A_PtrSize ? &quot;UPtr&quot; : &quot;UInt&quot;

	return DllCall(&quot;SelectObject&quot;, Ptr, hdc, Ptr, hgdiobj)
}
CreateCompatibleDC(hdc=0)
{
   return DllCall(&quot;CreateCompatibleDC&quot;, A_PtrSize ? &quot;UPtr&quot; : &quot;UInt&quot;, hdc)
}
Gdip_Startup()
{
	Ptr := A_PtrSize ? &quot;UPtr&quot; : &quot;UInt&quot;

	if !DllCall(&quot;GetModuleHandle&quot;, &quot;str&quot;, &quot;gdiplus&quot;, Ptr)
		DllCall(&quot;LoadLibrary&quot;, &quot;str&quot;, &quot;gdiplus&quot;)
	VarSetCapacity(si, A_PtrSize = 8 ? 24 : 16, 0), si := Chr(1)
	DllCall(&quot;gdiplus\GdiplusStartup&quot;, A_PtrSize ? &quot;UPtr*&quot; : &quot;uint*&quot;, pToken, Ptr, &amp;si, Ptr, 0)
	return pToken
}
GetDC(hwnd=0)
{
	return DllCall(&quot;GetDC&quot;, A_PtrSize ? &quot;UPtr&quot; : &quot;UInt&quot;, hwnd)
}
ReleaseDC(hdc, hwnd=0)
{
	Ptr := A_PtrSize ? &quot;UPtr&quot; : &quot;UInt&quot;

	return DllCall(&quot;ReleaseDC&quot;, Ptr, hwnd, Ptr, hdc)
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alectric)]]></author>
			<pubDate>Sat, 27 Jul 2019 15:51:08 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=135075#p135075</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131336#p131336</link>
			<description><![CDATA[<p>Чаще даже не спрашивает, а выводит сообщение что уже отключено.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 17 Jan 2019 11:57:43 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131336#p131336</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131333#p131333</link>
			<description><![CDATA[<p>Я такое не только у себя наблюдал.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 17 Jan 2019 11:26:23 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131333#p131333</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131329#p131329</link>
			<description><![CDATA[<p>С таким не сталкивался.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 17 Jan 2019 10:13:07 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131329#p131329</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131327#p131327</link>
			<description><![CDATA[<p>У меня иногда тоже работает. <br />А на счёт кто то будет переключать,&nbsp; так она может и сама отключатся от плохой производительности, и снова включится.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 17 Jan 2019 08:57:13 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131327#p131327</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131325#p131325</link>
			<description><![CDATA[<p>И у меня код из 201 поста нормально работает при включении/выключении композиции.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 17 Jan 2019 08:16:58 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131325#p131325</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131324#p131324</link>
			<description><![CDATA[<p>А думаешь кто-то будет постоянно включать/отключать композицию?</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 17 Jan 2019 08:11:35 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131324#p131324</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131323#p131323</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Тут видимо только ставить сообщение на DwmEnableComposition и перезагружать magnification.dll.</p></blockquote></div><p>Не удалось это сделать, так как при включении композции, процесс зависает.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 17 Jan 2019 08:08:44 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131323#p131323</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131209#p131209</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Тут видимо только ставить сообщение на DwmEnableComposition и перезагружать magnification.dll.</p></blockquote></div><p>Встроенная виндовая Magnify.exe при включении аеро меняет окно.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 14 Jan 2019 19:44:06 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131209#p131209</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131208#p131208</link>
			<description><![CDATA[<p>Сдвиг прибавляется к адресу.<br /></p><div class="codebox"><pre><code>&amp;To+4</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 14 Jan 2019 19:23:22 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131208#p131208</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131207#p131207</link>
			<description><![CDATA[<p>А есть функция с указателем сдвига? Надо вырезать начиная с 4 следующие 20 байт, и вставить их начиная с 4.<br /></p><div class="codebox"><pre><code>
VarSetCapacity(From, 24, 0)
VarSetCapacity(To, 24, 0)

NumPut(1, From, 0, &quot;UInt&quot;)
NumPut(11, From, 16, &quot;UInt&quot;)

NumPut(2, To, 0, &quot;UInt&quot;)
NumPut(22, To, 16, &quot;UInt&quot;)

MsgBox % NumGet(To, 0, &quot;UInt&quot;) &quot;`n&quot; NumGet(To, 16, &quot;UInt&quot;)

DllCall(&quot;msvcrt\memcpy&quot;
       , &quot;Ptr&quot;, &amp;To
       , &quot;Ptr&quot;, &amp;From
       , &quot;Uint&quot;, 24
       , &quot;Cdecl&quot;)
	   
MsgBox % NumGet(To, 0, &quot;UInt&quot;) &quot;`n&quot; NumGet(To, 16, &quot;UInt&quot;)
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 14 Jan 2019 19:20:13 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131207#p131207</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131205#p131205</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>При выключении \ включении аеро часто нарушается работоспособность лупы, при этом повышается нагрузка на процессор.</p></blockquote></div><p>Тут видимо только ставить сообщение на DwmEnableComposition и перезагружать magnification.dll.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 14 Jan 2019 18:54:09 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131205#p131205</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131204#p131204</link>
			<description><![CDATA[<p>Ну да, очевидно.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 14 Jan 2019 18:49:49 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131204#p131204</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131203#p131203</link>
			<description><![CDATA[<p>Там одни и те же картинки меняются в цикле.<br />А у тебя каждый раз новые.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 14 Jan 2019 18:48:40 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131203#p131203</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Экранная лупа]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=131202#p131202</link>
			<description><![CDATA[<p>А в 200 не скажешь почему DeleteObject&nbsp; не нужен?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 14 Jan 2019 18:43:13 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=131202#p131202</guid>
		</item>
	</channel>
</rss>
