Global $SRCCOPY = 0x00CC0020
Global $leave = 0
HotKeySet("{esc}","exit_x")
SplashTextOn ( "AU3MAG", "" , 100 , 100 , 0, 0, 1 )
$MyhWnd = WinGetHandle("AU3MAG")
While Not $leave
Sleep(25)
MAG()
WEnd
Func MAG()
$MyHDC = DLLCall("user32.dll","int","GetDC","hwnd",$MyhWnd)
If @error Then Return
$DeskHDC = DLLCall("user32.dll","int","GetDC","hwnd",0)
If Not @error Then
$xy = MouseGetPos()
If Not @error Then
$l = $xy[0]-10
$t = $xy[1]-10
DLLCall("gdi32.dll","int","StretchBlt","int",$MyHDC[0],"int",0,"int",0,"int",100,"int",100,"int",$DeskHDC[0],"int", $l,"int",$t,"int",20,"int",20,"long",$SRCCOPY)
EndIf
DLLCall("user32.dll","int","ReleaseDC","int",$DeskHDC[0],"hwnd",0)
EndIf
DLLCall("user32.dll","int","ReleaseDC","int",$MyHDC[0],"hwnd",$MyhWnd)
EndFunc
Func Exit_x()
Exit
EndFunc
美中不足,放大镜只是放大了像素,但是不能同时显示鼠标,不能精确显示目标点在放大镜里的位置。不能做到下图的效果: